6  Time series with data (Tsd)

import pynapple as nap
import numpy as np
times = np.arange(0, 10, 0.01)
signal = np.sin(2 * np.pi * times) 
signal += 0.2 * np.random.randn(len(times))
tsd = nap.Tsd(t=times, d=signal)
smoothed = tsd.smooth(std=0.1)
smoothed
Time (s)
-----------------  ---------
0.0                 0.161698
0.01                0.184316
0.02                0.208609
0.03                0.234484
0.04                0.261822
0.05                0.290471
0.06                0.320256
...
9.93               -0.458474
9.94               -0.424205
9.950000000000001  -0.390357
9.96               -0.357192
9.97               -0.324953
9.98               -0.293865
9.99               -0.264127
dtype: float64, shape: (1000,)