Pandas mengurutkan kolom berdasarkan nama
df = df.reindex(sorted(df.columns), axis=1)
Crowded Crossbill
df = df.reindex(sorted(df.columns), axis=1)
DataFrame.sort_values(
['column_to_sort_by'],
axis=0,
ascending=True,
inplace=False,
kind='quicksort',
na_position='last',
ignore_index=False,
key=None
)
>>> result = df.sort(['A', 'B'], ascending=[1, 0])