I have a dataframe
df = pd.DataFrame({'date':['2021-06','2021-06','2021-09','2021-08','2021-09'],'type':['t1','t1','t1','t2','t2'], 'other_col':['a','b','b','a','c']})
and would like to pivot it such that I get the following output.
date 2021-06 2021-08 2021-09
t1 count 2 0 1
mean 100% 0% 50%
t2 count 0 1 1
mean 0% 100% 50%
But I could not find out how to do it.