order by columns desc pandas code example Example: sort columns dataframe df = df.reindex(sorted(df.columns), axis=1)