条件熊猫的累积总和库
数据集
innings matchid over_count runs_total_inover
1 1000887 1 1.0
1 1000887 2 1.0
1 1000887 50 3.0
2 1000887 1 6.0
2 1000887 50 2.0
我想要这样的
innings matchid over_count runs_total_inover sum
1 1000887 1 1.0 1.0
1 1000887 2 1.0 2.0
1 1000887 50 3.0 5.0
2 1000887 1 6.0 6.0
2 1000887 50 2.0 8.0
my data set
innings matchid over_count runs_total_inover
1 1000887 1 1.0
1 1000887 2 1.0
1 1000887 50 3.0
2 1000887 1 6.0
2 1000887 50 2.0
i want like that
innings matchid over_count runs_total_inover sum
1 1000887 1 1.0 1.0
1 1000887 2 1.0 2.0
1 1000887 50 3.0 5.0
2 1000887 1 6.0 6.0
2 1000887 50 2.0 8.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iiuc,您可以尝试Groupby和Cumsum
IIUC, you can try groupby and cumsum