intent: How to swap a group of column headings with their values in Pandas
rewritten_intent: Sort the values of the dataframe `df` and align the columns accordingly based on the obtained indices after np.argsort.
snippet: pd.DataFrame(df.columns[np.argsort(df.values)], df.index, np.unique(df.values))