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) Map values using input correspondence (a dict, Series, or function).

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.CategoricalIndex.html