Re: sort values from dictionary of dictionaries python 2.4

2009-11-20 Thread J Wolfe
On Nov 9, 2:27 pm, Peter Otten <__pete...@web.de> wrote: > J Wolfe wrote: > > I would like to sort this dictionary by the values of the inner > > dictionary ‘ob’ key. > > Python's built-in dictionary is unsorted by design. > > > > > mydict = > > {’WILW1′: {’fx’: ‘8.1′, ‘obtime’: ‘2009-11-07 06:45:0

Re: sort values from dictionary of dictionaries python 2.4

2009-11-09 Thread Steven D'Aprano
On Mon, 09 Nov 2009 06:02:09 -0800, J Wolfe wrote: > Hi, > > I would like to sort this dictionary by the values of the inner > dictionary ‘ob’ key. You can't sort dictionaries in Python, because they are unordered hash tables. Giving up the ability to store items in order is one of the things

Re: sort values from dictionary of dictionaries python 2.4

2009-11-09 Thread Peter Otten
J Wolfe wrote: > I would like to sort this dictionary by the values of the inner > dictionary ‘ob’ key. Python's built-in dictionary is unsorted by design. > mydict = > {’WILW1′: {’fx’: ‘8.1′, ‘obtime’: ‘2009-11-07 06:45:00′, ‘ob’: ‘6.9′}, > ‘GRRW1′: {’fx’: ‘12.8′, ‘obtime’: ‘2009-11-07 04:15:0