I have the following pandas dataframe:
colA colB
idcode
3223 s1 13
3223 s2 18
211 s1 24
211 s2 43
211 s3 198
where colA and colB are the columns and idcode is the index for rows.
I would like to have as output a df as follows:
s1 s2 s3
idcode
3223 13 18 nan(or 0 but I'd prefer nan)
211 24 43 198
How can I do this?