[빅분기] 더미 변수 생성
X1 = data[['gender','region']] X1['gender'] = X1['gender'].replace([1,2],['male','female']) X1['region'] = X1['region'].replace([1,2,3,4,5],['Sudo','Chungcheung','Honam','Youngnam','Others']) X1_dum = pd.get_dummies(X1) Fvote = pd.concat([X1_dum, XY], axis=1 )
2022.06.15