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)
pd.cut(df.Age,bins=[0,2,17,65,99],labels=['Toddler/Baby','Child','Adult','Elderly'])
# where bins is cut off points of bins for the continuous data
# and key things here is that no. of labels is always less than 1
df['Gender'].str[0].str.upper().map({'M':'Male', 'F':'Female'})
## Converting Age to numeric variable
df['Gender']=pd.get_dummies(df['Gender'],drop_first=1)
df.head()