I'd like to sort a list of tuples by the magnitude of a unicode string, i.e. the first member of the tuple.
The "raw" tuples look like this:
A
[
[
(u'90000', 100318),
(u'21000', 58094),
(u'50000', 14695),
(u'250000', 8190),
(u'100000', 5718),
(u'40000', 4276)
]
]
After processing I'd like it to look like this:
B
[
[
(u'250000', 8190),
(u'100000', 5718),
(u'90000', 100318),
(u'50000', 14695),
(u'40000', 4276),
(u'21000', 58094)
]
]
I've tried some different approaches but I've not been able to get it to persist.
How to sort the list of tuples in A to render it like B?