1
我有一个像通过分组和大熊猫添加值拼合列
id, index, name, count1, count2
1, 1, foo, 12, 10
1, 2, foo, 11, 12
1, 3, foo, 23, 12
1, 1, bar, 11, 21
...
2, 1, foo, ...
一个数据帧我希望得到一个数据帧如下
id, name, count1, count2
1, foo, 46,34
1, bar, ..
所以基本上,我想“washaway”指数从这一领域..同时加入count1和count2列
我如何做到这一点在熊猫/ python?