0
Products Months  
A         12 
B         11
C         8
A         11
A         11
C         8
B         12

Above is my dataframe and I want following output using pandas

Months     8   11   12
Products   
A          0   2    1
B          0   1    1
C          2   0    0

I am new to pandas. How can I get above output using Pivot table? or any other method?

Ismail Hachimi
  • 653
  • 6
  • 11
Hetal
  • 21
  • 1
  • 4
  • https://stackoverflow.com/questions/33271098/python-get-a-frequency-count-based-on-two-columns-variables-in-pandas-datafra – BENY Feb 23 '18 at 03:59
  • The canonical pivot answer by @piRSquared : https://stackoverflow.com/questions/47152691/how-to-pivot-a-dataframe – cfort Feb 23 '18 at 04:30

0 Answers0