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         True
1.0         True
2.0         True
3.0         True
4.0         True
5.0         True
6.0         True
...
93.0        False
94.0        False
95.0        False
96.0        False
97.0        False
98.0        False
99.0        False
dtype: bool, shape: (100,)