I have a dictionary object that needs to be sorted, but the keys are date values in the form
[\'Apr. 2013\',\'May 2013\',\'Feb. 2013\', \'Mar. 2013\',\'Jul. 2013\',\'
I would replace each key with the respective formula:
newKey = year * monthRank
monthRank
would be 1 for January, 2 for February and so on. newKey
could then be used to sort every value. Of course this implys that you would have to parse the old keys in order to identify the monthRank
and year
, but converting the data from an unstructured data format to a sturctured one includes a cost you have to pay.
Hope I helped!