I have a requirement where in I am trying to count the values and Put them in the pivot table.
This is my dataframe,
Cola Colb Ap
IIUC:
In [178]: d.pivot_table(index='Cola', columns='Colb', aggfunc='size', fill_value=0) Out[178]: Colb Rippened UnRippened Cola Apple 1 1 Mango 0 1 Orange 1 0