Count of rows between contiguous on-off signals

前端 未结 0 1647
無奈伤痛
無奈伤痛 2020-12-07 09:18

I have a \'signal\' series with 1 values (on), -1 values (off) and zero values:

signal = pd.Series([0, 1, 0, 0, -1, 0, 1, 1, 0, -1])

I need to return the numbe

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