📜  按熊猫求和分组并创建新列 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:10.456000             🧑  作者: Mango

代码示例2
df['new_column'] = df.groupby(['group_column'])['sum_column'].transform('sum')