Window: aggregates inside this expression are computed per partition and broadcast back to each
row of the partition (polars over, SQL … OVER (PARTITION BY …)).
col('x').mean().over('g') // group mean on every row
col('x').sub(col('x').mean()).over('g') // deviation from own group's mean
col('x').div(col('x').sum().over(['a', 'b'])) // share within (a, b)
Optionaloptions: { descending?: boolean; orderBy?: string | string[] }
Optionaldescending?: booleanOptionalorderBy?: string | string[]Running (cumulative) aggregates in this row order — SQL OVER (PARTITION BY … ORDER BY …) / polars cum_sum().over().
Sample quantile q ∈ [0, 1]. col('x').quantile(0.25) // type 7: position (n − 1)q, linear interpolation (pandas default) col('x').quantile(0.25, 'minitab') // type 6: position q(n + 1), clamped to the sample — Minitab / SPSS / R type=6
Optionalmethod: QuantileMethod
Static value type of an expression (
T) and its output column name (N, set byalias). Both are phantom:col('x')isExpr<any>(nothing is known about a column named by string),c.xfrom a typed frame's column refs isExpr<S['x'], 'x'>, comparisons produceExpr<boolean>, arithmeticExpr<number>. Frames use them to typefilter,withColumn(s),selectandaggresults.