Answers for "group by two columns and count pandas"

0

pandas group by multiple columns and count

df.groupby(['col1', 'col2']).size() 
   .sort_values(ascending=False) 
   .reset_index(name='count')
Posted by: Guest on May-01-2021

Code answers related to "group by two columns and count pandas"

Python Answers by Framework

Browse Popular Code Answers by Language