I'm sure this is fairly easy to do but I can't figure it out. I'm coding in python and using pandas to work on dataframes. My dataframe looks like this:
a b c
1 10 20
1 30 40
1 60 70
1 80 100
2 10 20
2 60 70
2 80 100
And I would like to transform it like that:
a b1 c1 b2 c2 b3 c3 b4 c4
1 10 20 30 40 60 70 80 100
2 10 20 60 70 80 100 NA NA
Basically for every rows where the value in a is the same, take values in b and c and transform them into new columns, so that I end up with only one row for every value in a.
I hope I'm clear enough, if not don't hesitate to tell me. Thanks in advance for any help provided !
Florian.