📜  转换分类变量python代码示例

📅  最后修改于: 2022-03-11 14:45:54.866000             🧑  作者: Mango

代码示例1
from sklearn.preprocessing import LabelEncoder

lb_make = LabelEncoder()
obj_df["make_code"] = lb_make.fit_transform(obj_df["make"])
obj_df[["make", "make_code"]].head(11)