I have this list structure:
[[[6], [4], 1.0], [[5, 6], [4], 1.0], [[5], [6], 1.0], [[5], [4, 6], 1.0], [[5], [4], 1.0], [[4, 5], [6], 1.0], [[4], [6], 0.8]]
And I want to sort it via the 3rd element (descending order) and the lengths of the first and second list (first the ones which are smaller). I tried using
r = sorted(r, key=itemgetter(2, 0, 1), reverse=True)
which sorts the 3rd element in descending order, but how can I add the other sorting restrictions to this one?
Expected output:
[[[6], [4], 1.0], [[5], [6], 1.0], [[5], [6], 1.0], [[5], [4], 1.0], [[5], [4, 6], 1.0], [[5, 6], [4], 1.0], [[4, 5], [6], 1.0], [[4], [6], 0.8]]