pandas
Series.cat.codes
Return Series of codes as well as the index.
Examples
>>> raw_cate = pd.Categorical(["a", "b", "c", "a"], categories=["a", "b"]) >>> ser = pd.Series(raw_cate) >>> ser.cat.codes 0 0 1 1 2 -1 3 0 dtype: int8
previous
pandas.Series.cat.ordered
next
pandas.Series.cat.rename_categories