python check if data is categorical or not code example Example: how to check if the dataframe the category types df.dtype.name