Pandas group-by and sum code example Example: pandas groupby sum df.groupby(['Fruit','Name'])['Number'].sum()