I was wondering if someone knows a good way on how to sort a pandas dataframe in the following way:
a) I have the following randomly sorted data with an id that appears multiple times and a label that is either 0 or 1:
id | label ------ | ------ 1 | 1 1 | 0 1 | 0 2 | 1 2 | 0 2 | 0 3 | 0 3 | 0 3 | 0
I would like to sort the labels in ascending order and then also sort the id's in ascending order, but not grouped, so like this:
id | label ------ | ------ 1 | 0 2 | 0 3 | 0 1 | 0 2 | 0 3 | 0 3 | 0 1 | 1 2 | 1
Thanks in advance!