I have a large dataframe "df":
ph_level
0 low
1 medium
2 low
3 high
4 low
5 medium
I would like to add 3 binary columns for the low,medium,high data. Below is the output I am seeking:
ph_level low_binary medium_binary high_binary
0 low 1 0 0
1 medium 0 1 0
2 low 1 0 0
3 high 0 0 1
4 low 1 0 0
5 medium 0 1 0
Is there a very fast way to do this with pandas?
Thanks
