I got a list of lists:
A = [[5, 0], [4, 1], [0, 31/3], [0, 4/3], [1, 0], [5/4, 7/4]]
and want to sort it like this:
[[5, 0], [4, 1], [5/4, 7/4], [1, 0], [0, 31/3], [0, 4/3]]
With A.sort(reverse=True)
I sort it at least for the first entry. I got many lists because they pretend to be nxm matrices. So I can't transform the outer list to a set because "lines" (inner lists) may get deleted that way.
Edit: another example:
A = [[0, 168, 14], [0, 156, 13], [64, 64, 104], [0, 48, 4], [0, 0, 272], [8, 8, 13], [0, 0, 153]]
should be sorted as:
[[64, 64, 104], [8, 8, 13], [0, 168, 14], [0, 156, 13], [0, 48, 4], [0, 0, 272], [0, 0, 153]]