I have a dictionary of the form:
d = { 'someText': floatNumber }
Where floatNumber is an epoch timestamp. I’m trying to organise this such that time is in ascending order.
Example: {'someText':0000001, 'someText1':0000002, and so on}
Only way I can think of doing it is by looping with for k,v in dict.items() and then manually sorting it into a list but that may take a long time. Any help would be greatly appreciated.
Maybe you want:
which would generate a sorted list of tuples, like
Dictionaries cannot be sorted, so you have to use another data structure to store your key-value pairs.