how to group by and sum in pandas python code example Example: pandas groupby sum df.groupby(['Fruit','Name'])['Number'].sum()