Skip to main content
`Ctrl`+`K`

# pandas.Categorical.dtype

property Categorical.dtype

  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, str): ['a' < 'b']
      >>> cat.dtype
      CategoricalDtype(categories=['a', 'b'], ordered=True, categories_dtype=str)