I would like to generate a pivot table using py-pandas from this kind of data
id product credit
1 book -5
1 ipad -15
1 server -25
2 book -5
15 server -25
2 glass -2
2 glass -2
1 book -5
15 glass -2
1 car -150
to that sort of spreadsheet
id 1 2 15
---------------------------------
book -5 (2) -5(1) NA
ipad -15(1) NA NA
server -25(1) NA -25(1)
glass NA -2(2) -2(1)
car -150(1) NA NA
That will show the id as columns, product as rows, unit credit and number of of products bought.
Thanks for your help
-H