📜  获取假人并将它们输入到 pandas 数据框 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:51.349000             🧑  作者: Mango

代码示例1
note:
dummies = pd.get_dummies(df[['column_1']], drop_first=True)
df = pd.concat([df.drop(['column_1'],axis=1), dummies],axis=1)


note:for more that one coloum keep ading in the list 
dummies = pd.get_dummies(df[['column_1', 'column_2','column_3']], drop_first=True)
df = pd.concat([df.drop(['column_1', 'column_1'],axis=1), dummies],axis=1)