pandas.Categorical.dtype#
- property Categorical.dtype[source]#
The
CategoricalDtypefor this instance.See also
astypeCast argument to a specified dtype.
CategoricalDtypeType for categorical data.
Examples
>>> cat = pd.Categorical(["a", "b"], ordered=True) >>> cat ['a', 'b'] Categories (2, str): ['a' < 'b'] >>> cat.dtype CategoricalDtype(categories=['a', 'b'], ordered=True, categories_dtype=str)