pynapple.Ts.in_interval#

Ts.in_interval(iset)[source]#

Check which timestamps of the time series are within the intervals defined by an IntervalSet object

Parameters:

iset (IntervalSet) – the IntervalSet object

Returns:

A Tsd of indicating which timestamps are within the intervals

Return type:

Tsd

Examples

>>> import pynapple as nap
>>> import numpy as np
>>> t = np.arange(100)
>>> ep = nap.IntervalSet(start=0, end=50)
>>> ts = nap.Ts(t)
>>> ts.in_interval(ep)
Time (s)
----------  --
0.0          1
1.0          1
2.0          1
3.0          1
4.0          1
5.0          1
6.0          1
...
93.0         0
94.0         0
95.0         0
96.0         0
97.0         0
98.0         0
99.0         0
dtype: bool, shape: (100,)