polars.reduce#

polars.reduce(f: Callable[[Series, Series], Series], exprs: Union[Sequence[str | Expr], Expr]) Expr[source]#

Accumulate over multiple columns horizontally/ row wise with a left fold.

Parameters:
f

Function to apply over the accumulator and the value. Fn(acc, value) -> new_value

exprs

Expressions to aggregate over. May also be a wildcard expression.

Notes

See fold for the version with an explicit accumulator.