df.groupby(['col1','col2']).count() My groupby returns a dataframe (shape = 5, 1) like this
col1 col2 count
1 1 10
2 5
3 2
2 1 4
2 5
I would like to covert this into (5, 3) dataframe with col1 col2 being real columns.
col1 col2 count
1 1 10
1 2 5
1 3 2
2 1 4
2 2 5
I found several questions on this forum and outside. No luck.