pandas.CategoricalIndex.as_unordered#
- CategoricalIndex.as_unordered()[source]#
Set the CategoricalIndex to be unordered.
This method returns a new CategoricalIndex with the ordered attribute set to False, disabling comparison operations between categories.
- Returns:
- CategoricalIndex
Unordered CategoricalIndex.
See also
CategoricalIndex.as_orderedSet the CategoricalIndex to be ordered.
Examples
>>> ci = pd.CategoricalIndex(["a", "b", "c", "a"], ordered=True) >>> ci.ordered True >>> ci = ci.as_unordered() >>> ci.ordered False