Consider some data on berries.
It is possible to sort by any column. Here the DataFrame is sorted in order of ascending energy level:
In order of descending carbohydrate level:
It is also possible to sort columns with string and named values:
The output option controls the returned output for the sort command. Using permutation returns the list of numeric indices that sort the original DataFrame.
In order to obtain the data frame sorted by the row labels, you can use 0 as the index argument.
Several other sort options are also supported by the DataFrame sort command: