I'm working with pandas dataframe and I'm having a problem. I have a column named "status" and it may have 3 values, that are "married", "single" and "divorced". I want to change this dataframe creating 3 columns, that are "status married", "status single" and "status divorced". If in line 2, for example, the status is "married", the column "status married" receives number one and the another columns of this line receives 0. How can I do it in python? This solution has to be generic. Ps.: I'm sorry for my english, I hope you understand.
Asked
Active
Viewed 78 times