def reorder_levels(self, order):
if not isinstance(self.index, MultiIndex):  <EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>result = self.copy()<EOL>result.index = result.index.reorder_levels(order)<EOL>return result<EOL>
Rearrange index levels using input order.

May not drop or duplicate levels.

Parameters
----------
order : list of int representing new level order
       (reference level by number or key)

Returns
-------
type of caller (new object)