There is data frame like this:
id code count
0 1 101 777
1 1 102 170
2 1 103 65
3 2 101 43
4 2 102 40
'code' columns is a categorical variable and needs to be dummied based on value of column 'count' and aggregated for each 'id' and here is the table I would like to have:
id code_101 code_102 code_103
0 1 777 170 65
1 2 43 40 0
Any idea?