I am trying to sort tuples in list that have field of mixed nature: LABEL.NUMBER. For example:
aaaa.143
aadf.23
aaaa.8
..
So, I would like to sort first by LABEL as strings, and at the same by NUMBER as numbers, i.e. after sorting the should come:
aaaa.8
aaaa.143
aadf.23
..
I have now the following:
for i in sorted(v_distribution.items(), key=lambda x: x[0]):
which sorts using the whole filed as a string, so I get:
aaaa.143
aaaa.8
aadf.23
..
How should I modify my lambda function to do the task?