Optionalperiods: numberNatural log by default; pass base for log_b (e.g. log(10)).
Optionalbase: numberMedian. method: 'linear' (default; type 7, pandas / polars) or 'minitab' (type 6, position p(n + 1)) —
both give the middle value / midpoint for the median, the choice matters for other quantiles.
Optionalmethod: QuantileMethodWindow: 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().
Optionalperiods: numberSample 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: QuantileMethodRound half away from zero (Minitab / Excel ROUND) to decimals places.
Optionaldecimals: number
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. Transformations create unnamed expressions: usealias()last to name a computed output.asc()/desc()only wrap an existing expression and retain its name.