pyspark.pandas.Series.cat.as_unordered

cat.as_unordered(inplace: bool = False) → Optional[ps.Series]

Set the Categorical to be unordered.

Parameters
inplacebool, default False

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

Deprecated since version 3.4.0.

Returns
Series or None

Unordered Categorical or None if inplace=True.

Examples

>>> s = ps.Series(list("abbccc"), dtype="category").cat.as_ordered()
>>> s  
0    a
1    b
2    b
3    c
4    c
5    c
dtype: category
Categories (3, object): ['a' < 'b' < 'c']
>>> s.cat.as_unordered()  
0    a
1    b
2    b
3    c
4    c
5    c
dtype: category
Categories (3, object): ['a', 'b', 'c']