-1

something like a

#[derive(Clone, Debug)]
pub struct IntervalGroupOptions {
    pub index_column: String,
    /// start a window at this interval
    pub every: i32,
    /// window duration
    pub period: i32,
    /// offset window boundaries
    pub offset: i32,
    /// truncate the time column values to the window
    pub truncate: bool,
    // add the boundaries to the dataframe
    pub include_boundaries: bool,
    pub closed_window: ClosedWindow,
}

--> get the grouptuple and a broundary as a index

kmdreko
  • 42,554
  • 6
  • 57
  • 106
yutiansut
  • 11
  • 5
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 21 '22 at 07:33

1 Answers1

0

updated in https://github.com/pola-rs/polars/commit/f800a6418d90568798d92603237707dbe68c19bc

currently can use

        .groupby_dynamic(
            vec![],
            DynamicGroupOptions {
                index_column: "index".to_string(),
                every: Duration::parse("48i"),
                period: Duration::parse("240i"),
                offset: Duration::parse("0i"),
                truncate: false,
                include_boundaries: true,
                closed_window: ClosedWindow::Left,
            },
        )
        .agg([.........]).collect()
yutiansut
  • 11
  • 5