[Tutor] Sorting Dictionary of Dictionary by certain Value
Joe Python
jopython at gmail.com
Wed Sep 24 02:41:16 CEST 2008
Hi Pythonistas,
I have a large dictionary of dictionary (50,000+ keys) which has a structure
as follows:
DoD = {
'flintstones' : {
'husband' : "fred",
'pal' : "barney",
'income' : 500,
},
'jetsons' : {
'husband' : "george",
'wife' : "jane",
'his boy' : "elroy",
'income' : 700,
},
'simpsons' : {
'husband' : "homer",
'wife' : "marge",
'kid' : "bart",
'income' : 600,
},
};
I want to sort the dictionary by 'income'
Is there an efficient way to do the same.
Thanks in advance.
- Jo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080923/148f4074/attachment.htm>
More information about the Tutor
mailing list