我有以下类型的默认字典:
defaultdict(<type 'list'>, {573014L: [{564470L: 0.011759742609333696}, {573012L:
0.99999999999999978}, {573013L: 0.0032456927808054942}, {573015L:
0.0032456927808054942}, {573016L: 0.0038420894057914217}, {573017L:
0.0038420894057914217},
{573018L: 0.0034037733703310181}, {573019L: 0.0034037733703310181}], 573012L: [{564470L:
0.011759742609333696}, {573013L: 0.0032456927808054942}, {573014L: 0.99999999999999978},
{573015L: 0.0032456927808054942}, {573016L: 0.0038420894057914217}, {573017L:
0.0038420894057914217}, {573018L: 0.0034037733703310181}, {573019L:
0.0034037733703310181}] }
所以对于每个主键,我想根据它们的值对 (k,v) 对的列表进行排序。
例如。对于第一把钥匙
573014:[{573012:0.9999},{564470: 0.11759}.... and so on... decreasing values order...]
我如何以pythonic方式做到这一点
谢谢