polars_time::prelude

Function group_by_values

Source
pub fn group_by_values(
    period: Duration,
    offset: Duration,
    time: &[i64],
    closed_window: ClosedWindow,
    tu: TimeUnit,
    tz: Option<Tz>,
) -> PolarsResult<GroupsSlice>
Expand description

Different from group_by_windows, where define window buckets and search which values fit that pre-defined bucket.

This function defines every window based on the: - timestamp (lower bound) - timestamp + period (upper bound) where timestamps are the individual values in the array time