polars.Series.cat.get_categories#

Series.cat.get_categories() Series[source]#

Get the categories stored in this data type.

Examples

>>> s = pl.Series(["foo", "bar", "foo", "foo", "ham"], dtype=pl.Categorical)
>>> s.cat.get_categories()
shape: (3,)
Series: '' [str]
[
    "foo"
    "bar"
    "ham"
]