specifying category in python code example
Example 1: using df.astype to select categorical data and numerical data
df.satisfaction.astype("category",
ordered=True,
categories=ordered_satisfaction
)
Example 2: treat NaN as a category
g_without_nan = g.cat.add_categories("D").fillna("D")