how to rearrage dataframe colum asending code example Example: sort columns dataframe df = df.reindex(sorted(df.columns), axis=1)