Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.CategoricalIndex

class pandas.CategoricalIndex[source]

Immutable Index implementing an ordered, sliceable set. CategoricalIndex represents a sparsely populated Index with an underlying Categorical.

Parameters:

data : array-like or Categorical, (1-dimensional)

categories : optional, array-like

categories for the CategoricalIndex

ordered : boolean,

designating if the categories are ordered

copy : bool

Make a copy of input ndarray

name : object

Name to be stored in the index

See also

Categorical, Index

Attributes

codes
categories
ordered

Methods

rename_categories(*args, **kwargs) Renames categories.
reorder_categories(*args, **kwargs) Reorders categories as specified in new_categories.
add_categories(*args, **kwargs) Add new categories.
remove_categories(*args, **kwargs) Removes the specified categories.
remove_unused_categories(*args, **kwargs) Removes categories which are not used.
set_categories(*args, **kwargs) Sets the categories to the specified new_categories.
as_ordered(*args, **kwargs) Sets the Categorical to be ordered
as_unordered(*args, **kwargs) Sets the Categorical to be unordered
map(mapper) Apply mapper function to its categories (not codes).
Scroll To Top