how to sort using 2 columns in pandas dataframe code example Example: sort by two columns in pandas df.sort_values(['a', 'b'], ascending=[True, False])