pandas.MultiIndex.reorder_levels

MultiIndex.reorder_levels(order)[source]

Rearrange levels using input order. May not drop or duplicate levels.

Parameters
orderlist of int or list of str

List representing new level order. Reference level by number (position) or by key (label).

Returns
MultiIndex