Function polars_lazy::dsl::reduce_exprs
source · pub fn reduce_exprs<F, E>(f: F, exprs: E) -> Exprwhere
F: 'static + Fn(Series, Series) -> Result<Option<Series>, PolarsError> + Send + Sync + Clone,
E: AsRef<[Expr]>,
Expand description
Analogous to Iterator::reduce
.
An accumulator is initialized to the series given by the first expression in exprs
, and then each subsequent value
of the accumulator is computed from f(acc, next_expr_series)
. If exprs
is empty, an error is returned when
collect
is called.