There must be an obvious answer but I could neither find it in the sort_values()'s docs nor in related questions posts*
by in df.sort_values() accept columns labels, but How do I sort using the columns' position ?
I came up with this cumbersome code
df.iloc[df.iloc[:,1].sort_values().index]
to sort on the second column.
I was thinking that something like df.sort_values(by=1,axis=1) would exist. So what is syntacticly simple and correct way to do that ?
df.iloc[:, np.argsort(df.columns.values)]will reorder the columns in the df, right ? What I need is to sort the df on, for example, the 33th column's values.