df1=
A B
61880 7
62646 8
62651 9
62656 10
62783 11
61880 3
62646 2
我想做data.groupby('A')['B'].sum()
,但是要根据“a”的值将“B”的结果保存为新列“B\u updated”
在data.groupby('A')['B'].sum()
之后,我的输出是:
A B
61880 10
62646 10
...
很好,但我不能做进一步的手术。因此,我想保存“B”和“A”。因为我的下一个操作是Math operations of column based on same values of other column pandas
试试这个:
相关问题 更多 >
编程相关推荐