Function polars::prelude::map_list_multiple

source ·
pub fn map_list_multiple<F, E>(
    function: F,
    expr: E,
    output_type: SpecialEq<Arc<dyn FunctionOutputField>>
) -> Expr
where F: Fn(&mut [Series]) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync, E: AsRef<[Expr]>,
Available on crate feature lazy only.
Expand description

Apply a function/closure over multiple columns once the logical plan get executed.

This function is very similar to [apply_mul], but differs in how it handles aggregations.

  • map_mul should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply_mul should be used for operations that work on a group of data. e.g. sum, count, etc.
  • map_list_mul should be used when the function expects a list aggregated series.