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