码迷,mamicode.com
首页 > 其他好文 > 详细

pandas cumsum/sum calc percentage

时间:2017-01-10 11:40:45      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:lan   ted   span   tty   sum   tag   str   percent   msu   

df[‘cum_sum‘] = df.val1.cumsum()
df[‘cum_perc‘] = 100*df.cum_sum/df.val1.sum()

pandas cumsum/sum calc percentage

标签:lan   ted   span   tty   sum   tag   str   percent   msu   

原文地址:http://www.cnblogs.com/ppqchina/p/6268623.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!