pandas.Categorical.dtype#

property Categorical.dtype[源代码]#

这个实例的 CategoricalDtype

参见

astype

将参数转换为指定的数据类型。

CategoricalDtype

分类数据的类型。

示例

>>> 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)