def _set_levels(self, levels):
        warn("Assigning to 'levels' is deprecated, use 'categories'",
             FutureWarning, stacklevel=2)
        self.categories = levels
set new levels (deprecated, use "categories")
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical._set_levels