pandas / 1.4.0 / reference / api / pandas.categoricalindex.as_ordered.html /

pandas.CategoricalIndex.as_ordered

CategoricalIndex. as_ordered ( *args, **kwargs ) [source]

Set the Categorical to be ordered.

Parameters
inplace :bool, default False

Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True.

Returns
Categorical or None

Ordered Categorical or None if inplace=True.

© 2008–2022, 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/1.4.0/reference/api/pandas.CategoricalIndex.as_ordered.html