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
Please try this code
new_column=df[['col1', 'col2', 'col3', 'col4']].groupby(['col1', 'col2']).count() df['count_it']=new_column df
I think that code will add a column called 'count it' which count of each group