Closed
Description
What is the preferred way to check for categorical dtype?
I now answered:
In [42]: isinstance(df.cat_column.dtype, pd.core.common.CategoricalDtype)
Out[42]: True
In [43]: pd.core.common.is_categorical_dtype(df.cat_column)
Out[43]: True
But:
- this seems somewhat buried in pandas. Should there be a more top-level function to do this?
- we should add the preferred way to the categorical docs.