我有一个记录事件发生的列表:
a = [0,0,1,1,1,0,0,1,1,0,0,0,0,1,1,1,1,1,0,0,0,1,1]
1表示在给定的时间步中事件的发生,0表示未观察到事件的时间步。你知道吗
我有兴趣在python上估计事件间隔的统计数据。也就是说,timesI的统计数据没有记录任何事件(0):例如
- mean of interval of events: (2+4+3)/3 = 3
- max duration of an interval of no-event: 4
有什么建议我该怎么做吗?你知道吗
非常感谢
Tags:
这是一种做你想做的事的方法。当然有更有效的方法,但这很简单:
这是结果
相关问题 更多 >
编程相关推荐