polars.Expr.map¶
- Expr.map(f: Callable[[polars.internals.series.Series], polars.internals.series.Series], return_dtype: Optional[Type[polars.datatypes.DataType]] = None, agg_list: bool = False) polars.internals.expr.Expr ¶
Apply a custom python function. This function must produce a Series. Any other value will be stored as null/missing. If you want to apply a function over single values, consider using apply.
[read more in the book](https://pola-rs.github.io/polars-book/user-guide/howcani/apply/udfs.html)
- Parameters
- f
Lambda/ function to apply.
- return_dtype
Dtype of the output Series.
- agg_list