Is a constant sampling rate required?
In your Usage window, it says that a constant sampling rate is assumed. Is that generally the case, or just in the example? Under Limitations and Assumptions nothing is mentioned, hence the question :)
Nope, this is not required :)
This library assumes a constant sampling rate if only y is passed to the downsample function. If both x and y are passed, the x data is used to determine the bin sizes / find gaps when downsampling.
Hope this answers your question!
- Jeroen
Hi Jeroen, but the output data remains variably sampled right? Is there a way to convert to a fixed sample rate when remapling?
Yes, you can do that with resampling functions - which is not part of this library (as the focus of tsdownsample is shape-preserving data point selection; in other words, tsdownsample selects point from the original time series).
More information about resampling functions:
-
pandasdocumentation: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html -
polarsdocumentation: https://docs.pola.rs/user-guide/transformations/time-series/resampling/