getting dummies and input them to pandas dataframe

Solutions on MaxInterview for getting dummies and input them to pandas dataframe by the best coders in the world

showing results for - "getting dummies and input them to pandas dataframe"
Matías
28 Nov 2016
1note:
2dummies = pd.get_dummies(df[['column_1']], drop_first=True)
3df = pd.concat([df.drop(['column_1'],axis=1), dummies],axis=1)
4
5
6note:for more that one coloum keep ading in the list 
7dummies = pd.get_dummies(df[['column_1', 'column_2','column_3']], drop_first=True)
8df = pd.concat([df.drop(['column_1', 'column_1'],axis=1), dummies],axis=1)
9