I have a .csv label and have four different categories.
and now my .csv file looks like this:
id type
1 1
2 2
3 3
4 4
5 2
...
I want to convert it to like:
id type1 type2 type3 type4
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
5 0 1 0 0
how can I done these via python? I use pd.read_csv()