Reputation: 1082
I have this dataset:
Players Material_bough
1 X1 Wood
2 X2 Iron
3 X1 Stone
I would like to create a new column that shows the sum of materials a player bought.
Players Material_bough Material_total
1 X1 Wood 2
2 X2 Iron 1
3 X1 Stone 2
As Wood + Stone = 2 materials.
I think I should use groupby but don't know how.
Upvotes: 1
Views: 67