ktk.TimeSeries.fill_missing_samples#

TimeSeries.fill_missing_samples(max_missing_samples, *, method='linear', in_place=False)[source]#

Fill missing samples using a given method.

Parameters
  • max_missing_samples (int) – Maximal number of consecutive missing samples to fill. Set to zero to fill all missing samples.

  • method (str) – Optional. The interpolation method. This input may take any value supported by scipy.interpolate.interp1d, such as “linear”, “nearest”, “zero”, “slinear”, “quadratic”, “cubic”, “previous” or “next”. Default is “linear”.

  • in_place (bool) – Optional. True to modify and return the original TimeSeries. False to return a modified copy of the TimeSeries while leaving the original TimeSeries intact. Default is False.

Returns

The TimeSeries with the missing samples filled.

Return type

TimeSeries

Raises

ValueError – If the sample rate is not constant.