#NEWLINE# def rename_categories( self , new_categories , inplace = False ) : #NEWLINE# #INDENT# ' Renames categories.\n\n        The new categories has to be a list-like object. All items must be\n        unique and the number of items in the new categories must be the same\n        as the number of items in the old categories.\n\n        Raises\n        ------\n        ValueError\n            If the new categories do not have the same number of items than the\n            current categories or do not validate as categories\n\n        Parameters\n        ----------\n        new_categories : Index-like\n           The renamed categories.\n        inplace : boolean (default: False)\n           Whether or not to rename the categories inplace or return a copy of\n           this categorical with renamed categories.\n\n        Returns\n        -------\n        cat : Categorical with renamed categories added or None if inplace.\n\n        See also\n        --------\n        reorder_categories\n        add_categories\n        remove_categories\n        remove_unused_categories\n        set_categories\n        ' #NEWLINE# cat = ( self if inplace else self . copy ( ) ) #NEWLINE# cat . categories = new_categories #NEWLINE# if ( not inplace ) : #NEWLINE# #INDENT# return cat