def astype(self, dtype):
        if is_categorical_dtype(dtype):
            return self
        return np.array(self, dtype=dtype)
coerce this type to another dtype
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.astype