polars.Expr.map#

Expr.map(
function: Callable[[Series], Series | Any],
return_dtype: PolarsDataType | None = None,
*,
agg_list: bool = False,
) Self[source]#

Apply a custom python function to a Series or sequence of Series.

Deprecated since version 0.19.0: This method has been renamed to Expr.map_batches().

Parameters:
function

Lambda/ function to apply.

return_dtype

Dtype of the output Series.

agg_list

Aggregate list