It looks like sort()
does not preserve ordering, and it does not support sorting on multiple columns, nor a key function.
Preserved ordering when sorting is very handy when one needs to sort on multiple columns, A
and B
, so that e.g. whenever A
is equal for two or more rows, B
is kept sorted.
In native Python one could do the latter (other than sorting by a key function specifying that) by sorting by B
first, then by A
.
What’s the recommended way to achieve this with Datasets?