I have a data frame df and I use several columns from it to groupby:
df
groupby
df[\'col1\',\'col2\',\'col3\',\'col4\'].groupby([\'col1\',\'co
On groupby object, the agg function can take a list to apply several aggregation methods at once. This should give you the result you need:
agg
df[['col1', 'col2', 'col3', 'col4']].groupby(['col1', 'col2']).agg(['mean', 'count'])