pandas.Categorical.from_codes
- classmethod Categorical.from_codes(codes, categories=None, ordered=None, dtype=None, validate=True)
Make a Categorical type from codes and categories or dtype.
This constructor is useful if you already have codes and categories/dtype and so do not need the (computation intensive) factorization step, which is usually done on the constructor.
If your data does not follow this convention, please use the normal constructor.