The default behavior of pandas groupby is to turn the group by columns into index and remove them from the list of columns of the dataframe. For instance, say I have a dataF
Another way to do this would be:
df.groupby(['col2', 'col3']).sum().reset_index()