Resampling techniques
In time series analysis, there are two types of resampling techniques, upsampling and downsampling. Resampling in the context of time series analysis means changing the frequency of the data points.
Upsampling refers to the process of increasing the frequency or granularity of your data. This means converting a time series from a lower frequency to a higher frequency. If you have week-level data, then upsampling could be used to fill in values to create daily data points.
On the other hand, downsampling is the process of decreasing the frequency or granularity of your data. If you have day-level data, then this may involve aggregating your data to create monthly intervals.
In this recipe, we’ll look at how to apply both upsampling and downsampling in Python Polars.
How to do it...
Here’s how to apply resampling techniques.
- The Toronto weather dataset contains hour-level data. Let’s see how we can downsample the data...