CategoricalIndex.set_names()

CategoricalIndex.set_names(names, level=None, inplace=False) [source] Set new names on index. Defaults to returning new index. Parameters: names : str or sequence name(s) to set level : int, level name, or sequence of int/level names (default None) If the index is a MultiIndex (hierarchical), level(s) to set (None for all levels). Otherwise level must be None inplace : bool if True, mutates in place Returns: new index (of same type and class...etc) [if inplace, returns None] Examp

CategoricalIndex.set_categories()

CategoricalIndex.set_categories(*args, **kwargs) [source] Sets the categories to the specified new_categories. new_categories can include new categories (which will result in unused categories) or remove old categories (which results in values set to NaN). If rename==True, the categories will simple be renamed (less or more items than in old categories will result in values set to NaN or in unused categories respectively). This method can be used to perform more than one action of adding, r

CategoricalIndex.searchsorted()

CategoricalIndex.searchsorted(key, side='left', sorter=None) [source] Find indices where elements should be inserted to maintain order. Find the indices into a sorted IndexOpsMixin self such that, if the corresponding elements in v were inserted before the indices, the order of self would be preserved. Parameters: key : array_like Values to insert into self. side : {?left?, ?right?}, optional If ?left?, the index of the first suitable location found is given. If ?right?, return the last

CategoricalIndex.reshape()

CategoricalIndex.reshape(*args, **kwargs) [source] NOT IMPLEMENTED: do not call this method, as reshaping is not supported for Index objects and will raise an error. Reshape an Index.

CategoricalIndex.repeat()

CategoricalIndex.repeat(n, *args, **kwargs) [source] Repeat elements of an Index. Refer to numpy.ndarray.repeat for more information about the n argument. See also numpy.ndarray.repeat

CategoricalIndex.reorder_categories()

CategoricalIndex.reorder_categories(*args, **kwargs) [source] Reorders categories as specified in new_categories. new_categories need to include all old categories and no new category items. 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 inpl

CategoricalIndex.rename_categories()

CategoricalIndex.rename_categories(*args, **kwargs) [source] Renames categories. The new categories has to be a list-like object. All items must be unique and the number of items in the new categories must be the same as the number of items in the old categories. Parameters: new_categories : Index-like The renamed categories. inplace : boolean (default: False) Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories. Returns: cat :

CategoricalIndex.rename()

CategoricalIndex.rename(name, inplace=False) [source] Set new names on index. Defaults to returning new index. Parameters: name : str or list name to set inplace : bool if True, mutates in place Returns: new index (of same type and class...etc) [if inplace, returns None]

CategoricalIndex.remove_unused_categories()

CategoricalIndex.remove_unused_categories(*args, **kwargs) [source] Removes categories which are not used. Parameters: inplace : boolean (default: False) Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped. Returns: cat : Categorical with unused categories dropped or None if inplace. See also rename_categories, reorder_categories, add_categories, remove_categories, set_categories

CategoricalIndex.remove_categories()

CategoricalIndex.remove_categories(*args, **kwargs) [source] Removes the specified categories. removals must be included in the old categories. Values which were in the removed categories will be set to NaN Parameters: removals : category or list of categories The categories which should be removed. inplace : boolean (default: False) Whether or not to remove the categories inplace or return a copy of this categorical with removed categories. Returns: cat : Categorical with removed ca