I would like to count number of yes and no values by Column and groupby index.
I have this dataframe :
col0 col1 col2
A yes no
A no no
B yes yes
B yes no
I want this:
col1 col2
yes no yes no
A 1 1 0 2
B 2 0 1 1
I tried with df.pivot_table(index='my_index', aggfunc='count')
but i only got
col1 col2
A 2 2
B 2 2