pandas.CategoricalIndex.ordered#
- property CategoricalIndex.ordered[source]#
Whether the categories have an ordered relationship.
This property returns True if the categories are ordered, meaning they have a meaningful order that allows comparison operations.
See also
CategoricalIndex.as_orderedSet the CategoricalIndex to be ordered.
CategoricalIndex.as_unorderedSet the CategoricalIndex to be unordered.
Examples
>>> ci = pd.CategoricalIndex(["a", "b"], ordered=True) >>> ci.ordered True
>>> ci = pd.CategoricalIndex(["a", "b"], ordered=False) >>> ci.ordered False