pandas group by multiple columns and count code example
Example: pandas group by multiple columns and count
df.groupby(['col1', 'col2']).size()
.sort_values(ascending=False)
.reset_index(name='count')
df.groupby(['col1', 'col2']).size()
.sort_values(ascending=False)
.reset_index(name='count')