df.groupby(['A','C'], as_index=False)['B'].sum()
df['new_column'] = df.groupby(['group_column'])['sum_column'].transform('sum')