pandas.CategoricalDtype.categories#
- property CategoricalDtype.categories[source]#
An
Indexcontaining the unique categories allowed.If no categories were explicitly provided at construction time, this will be
Noneuntil theCategoricalDtypeis attached to actual data.See also
orderedWhether the categories have an ordered relationship.
Examples
>>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=True) >>> cat_type.categories Index(['a', 'b'], dtype='str')