pandas.Categorical.as_unordered#
- Categorical.as_unordered()[source]#
Set the Categorical to be unordered.
- Returns:
- Categorical
Unordered Categorical.
See also
as_ordered
Set the Categorical to be ordered.
Examples
For
pandas.Series
:>>> raw_cat = pd.Categorical(["a", "b", "c", "a"], ordered=True) >>> ser = pd.Series(raw_cat) >>> ser.cat.ordered True >>> ser = ser.cat.as_unordered() >>> ser.cat.ordered False
>>> ci = pd.CategoricalIndex(["a", "b", "c", "a"], ordered=True) >>> ci.ordered True >>> ci = ci.as_unordered() >>> ci.ordered False