-1

类似的东西

#[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,
}

--> 获取 grouptuple 和 broundary 作为索引

4

1 回答 1

0

https://github.com/pola-rs/polars/commit/f800a6418d90568798d92603237707dbe68c19bc中更新

目前可以使用

        .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()
于 2022-01-12T07:40:58.707 回答