You can do this with traces. First, create a TimeSeries
with your irregular measurements like you would a dictionary:
ts = traces.TimeSeries([
(datetime(1992, 8, 27, 7, 46, 48), 28.0),
(datetime(1992, 8, 27, 8, 0, 48), 28.2),
...
(datetime(1992, 8, 27, 9, 3, 48), 30.0),
])
Then regularize using the sample
method:
ts.sample(
sampling_period=timedelta(minutes=15),
start=datetime(1992, 8, 27, 8),
end=datetime(1992, 8, 27, 9),
interpolate='linear',
)
This results in the following regularized version, where the gray dots are the original data and the orange is the regularized version with linear interpolation.
The interpolated values are:
1992-08-27 08:00:00 28.189
1992-08-27 08:15:00 28.286
1992-08-27 08:30:00 28.377
1992-08-27 08:45:00 28.848
1992-08-27 09:00:00 29.891
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…