sort a column of a pandas df code example Example: dataframe, sort by columns final_df = df.sort_values(by=['2'], ascending=False)