Cumulative Sum with Groupby

前端 未结 0 367
有刺的猬
有刺的猬 2021-02-06 23:22

Lets say we have the following dataframe. If we wanted to find the count of consecutive 1\'s, you could use the below.

    col
0   0
1   1
2   1
3   1
4   0
5   0         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题