1/11/2019 - 1:22 PM

Get dummies for multiple categorical columns

#We will create new Feature data frame as a sub of df
#We first define the new columns
#We then turn education column categorical variables to new columns with dummy variables (0,1,2..)
#In the end, we drop 'Master or Above' 

Feature = df[['Principal','terms','age','Gender','weekend']]
Feature = pd.concat([Feature,pd.get_dummies(df['education'])], axis=1)
Feature.drop(['Master or Above'], axis = 1,inplace=True)