aggregate only certain columns in python when group by code example Example: python - gropuby based on 2 variabels df.groupby(['col5', 'col2']).size()