DataFrame.
swaplevel
Swap levels i and j in a MultiIndex on a particular axis.
Levels of the indices to be swapped. Can pass level name as string.
The axis to swap levels on. 0 or ‘index’ for row-wise, 1 or ‘columns’ for column-wise.