Data, Python, Pandas, Sorting.
and then by column 'B' in descending order sorted_multi = df.sort_values(by=['A', 'B'], ascending=[True, False]) print(sorted_multi) Output: A B 3 12 0.543858 1 23 0.792037 4 45 0.311822 0 56 0.948045 2 89 0.134720 Summary In this tutorial, we learned how to sort data using pandas in Python. We