CategoryMapping.from_series()

CategoryMapping.from_series()#

classmethod CategoryMapping.from_series(series)[source]#

When series is a pd.Categorical, the category sorting is kept. When series is a series of dtype str or object, categories are sorted alphabetically.

Return type:

CategoryMapping