Assuming you have a pandas dataframe called df
, and you want to sort by the column "nl10107", you can use the sort_values
function from pandas library with parameter "by" set to the desired column name. Then you can use the resulting dataframe's index to obtain the sort order. Here's an example:
main.py335 chars17 lines
The output will be:
main.py101 chars7 lines
The sort_order
variable contains the index values of the sorted dataframe, which represents the sort order.
gistlibby LogSnag