pub trait PolarsUpsample {
    fn upsample<I>(
        &self,
        by: I,
        time_column: &str,
        every: Duration,
        offset: Duration
    ) -> Result<DataFrame, PolarsError>
    where
        I: IntoVec<String>
;
fn upsample_stable<I>(
        &self,
        by: I,
        time_column: &str,
        every: Duration,
        offset: Duration
    ) -> Result<DataFrame, PolarsError>
    where
        I: IntoVec<String>
; }

Required methods

Upsample a DataFrame at a regular frequency.

Arguments
  • by - First group by these columns and then upsample for every group
  • time_column - Will be used to determine a date_range. Note that this column has to be sorted for the output to make sense.
  • every - interval will start ‘every’ duration
  • offset - change the start of the date_range by this offset.

The period and offset arguments are created with the following string language:

  • 1ns (1 nanosecond)
  • 1us (1 microsecond)
  • 1ms (1 millisecond)
  • 1s (1 second)
  • 1m (1 minute)
  • 1h (1 hour)
  • 1d (1 day)
  • 1w (1 week)
  • 1mo (1 calendar month)
  • 1y (1 calendar year)
  • 1i (1 index count) Or combine them: “3d12h4m25s” # 3 days, 12 hours, 4 minutes, and 25 seconds

Upsample a DataFrame at a regular frequency.

Arguments
  • by - First group by these columns and then upsample for every group
  • time_column - Will be used to determine a date_range. Note that this column has to be sorted for the output to make sense.
  • every - interval will start ‘every’ duration
  • offset - change the start of the date_range by this offset.

The period and offset arguments are created with the following string language:

  • 1ns (1 nanosecond)
  • 1us (1 microsecond)
  • 1ms (1 millisecond)
  • 1s (1 second)
  • 1m (1 minute)
  • 1h (1 hour)
  • 1d (1 day)
  • 1w (1 week)
  • 1mo (1 calendar month)
  • 1y (1 calendar year)
  • 1i (1 index count) Or combine them: “3d12h4m25s” # 3 days, 12 hours, 4 minutes, and 25 seconds

Implementors