1pd.cut(df.Age,bins=[0,2,17,65,99],labels=['Toddler/Baby','Child','Adult','Elderly'])
2# where bins is cut off points of bins for the continuous data
3# and key things here is that no. of labels is always less than 1
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