def reorder_categories(self, new_categories, ordered=None, inplace=False):
    ' Reorders categories as specified in new_categories.\n\n        `new_categories` need to include all old categories and no new category\n        items.\n\n        Raises\n        ------\n        ValueError\n            If the new categories do not contain all old category items or any\n            new ones\n\n        Parameters\n        ----------\n        new_categories : Index-like\n           The categories in new order.\n        ordered : boolean, optional\n           Whether or not the categorical is treated as a ordered categorical.\n           If not given, do not change the ordered information.\n        inplace : boolean (default: False)\n           Whether or not to reorder the categories inplace or return a copy of\n           this categorical with reordered categories.\n\n        Returns\n        -------\n        cat : Categorical with reordered categories or None if inplace.\n\n        See also\n        --------\n        rename_categories\n        add_categories\n        remove_categories\n        remove_unused_categories\n        set_categories\n        '
    inplace = validate_bool_kwarg(inplace, 'inplace')
    if (set(self.dtype.categories) != set(new_categories)):
        raise ValueError('items in new_categories are not the same as in old categories')
    return self.set_categories(new_categories, ordered=ordered, inplace=inplace)
Reorders categories as specified in new_categories.

`new_categories` need to include all old categories and no new category
items.

Raises
------
ValueError
    If the new categories do not contain all old category items or any
    new ones

Parameters
----------
new_categories : Index-like
   The categories in new order.
ordered : boolean, optional
   Whether or not the categorical is treated as a ordered categorical.
   If not given, do not change the ordered information.
inplace : boolean (default: False)
   Whether or not to reorder the categories inplace or return a copy of
   this categorical with reordered categories.

Returns
-------
cat : Categorical with reordered categories or None if inplace.

See also
--------
rename_categories
add_categories
remove_categories
remove_unused_categories
set_categories
def reorder_categories(self, new_categories, ordered=None, inplace=False):
    ' Reorders categories as specified in new_categories.\n\n        `new_categories` need to include all old categories and no new category\n        items.\n\n        Raises\n        ------\n        ValueError\n            If the new categories do not contain all old category items or any\n            new ones\n\n        Parameters\n        ----------\n        new_categories : Index-like\n           The categories in new order.\n        ordered : boolean, optional\n           Whether or not the categorical is treated as a ordered categorical.\n           If not given, do not change the ordered information.\n        inplace : boolean (default: False)\n           Whether or not to reorder the categories inplace or return a copy of\n           this categorical with reordered categories.\n\n        Returns\n        -------\n        cat : Categorical with reordered categories or None if inplace.\n\n        See also\n        --------\n        rename_categories\n        add_categories\n        remove_categories\n        remove_unused_categories\n        set_categories\n        '
    inplace = validate_bool_kwarg(inplace, 'inplace')
    if (set(self.dtype.categories) != set(new_categories)):
        raise ValueError('items in new_categories are not the same as in old categories')
    return self.set_categories(new_categories, ordered=ordered, inplace=inplace)