LazyFrame.rheon.with_windows¶
- LazyFrameRheonNamespace.with_windows(*exprs: pl.Expr, clock: str | None = None, gap_cap: float | Duration | None = None, restart_after_step_back: float | Duration | None = None, session: str | None = None, session_gap: float | Duration | None = None, group: str | None = None, like: dict[str, Any] | None = None, chunk_size: int | None = None, load_state: State | bytes | None = None, save_state: State | None = None, **named: pl.Expr) pl.LazyFrame[source]¶
Add one column per window operator’s expression to a query’s rows, as the query runs.
It is
rheon.polars.stream.with_windows()as a method, so a query can add window operators’ values and fit on them in one chain. For a frame in memory, usedf.rheon.with_windows.Parameters
*exprs,**namedand every keywordAs
rheon.polars.stream.with_windows()takes them, with the query as its input.
Returns
A query holding the input’s rows with one column added per expression, as
rheon.polars.stream.with_windows()returns it.Raises
What
rheon.polars.stream.with_windows()raises.Examples
This code reads
trades.parquetfrom Example data:fitted = ( pl.scan_parquet("trades.parquet") .rheon.with_windows( mid_5s=rp.ewm_mean("mid", half_life="5s", window_size="1m"), clock="ts", gap_cap="5m", group="symbol", ) .collect() ) print(fitted.columns[-1], fitted.height)
mid_5s 3000
See also
rheon.polars.stream.with_windows(), every parameter and what it refuses.rheon.polars.ops, the window operators.