pynapple.TsdTensor.in_interval#
- TsdTensor.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:
Examples
>>> import pynapple as nap >>> import numpy as np >>> t = np.arange(100) >>> ep = nap.IntervalSet(start=0, end=50) >>> tsdtensor = nap.TsdTensor(t=t, d=np.random.randn(len(t), 4, 4)) >>> tsdtensor.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,)