I\'m trying to reorder/swaplevel/pivot/something columns in a pandas dataframe. The columns are a MultiIndex, but I can\'t find the sauce to do what I want.
The fastest
Since levels indices are no more mandatory you can have even more simple way to achieve the level swapping of multi-index dataframe:
df = df.swaplevel(axis='columns')