sort just column pandas code example Example: sort columns dataframe df = df.reindex(sorted(df.columns), axis=1)