1from sklearn.preprocessing import LabelEncoder
2
3lb_make = LabelEncoder()
4obj_df["make_code"] = lb_make.fit_transform(obj_df["make"])
5obj_df[["make", "make_code"]].head(11)
6
1#this will label as one hot vectors (origin is split into 3 columns - USA, Europe, Japan and any one place will be 1 while the others are 0)
2dataset['Origin'] = dataset['Origin'].map({1: 'USA', 2: 'Europe', 3: 'Japan'})