groupyby count of category code example Example: groupby count pandas df.groupby(['col1', 'col2']).size()