From 3d4e494b7b4919b07115a6126004512c438e2209 Mon Sep 17 00:00:00 2001 From: Dean MacGregor Date: Tue, 30 Jan 2024 14:49:19 -0500 Subject: [PATCH] docstrings --- py-polars/polars/expr/expr.py | 5 ++++- py-polars/polars/series/series.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 49e0cfe61840..5306415ec372 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -4037,6 +4037,8 @@ def map_batches( Lambda/function to apply. return_dtype Dtype of the output Series. + If not set, the dtype will be inferred based on the first non-null value + that is returned by the function. is_elementwise If set to true this can run in the streaming engine, but may yield incorrect results in group-by. Ensure you know what you are doing! @@ -4161,7 +4163,8 @@ def map_elements( Lambda/function to map. return_dtype Dtype of the output Series. - If not set, the dtype will be `pl.Unknown`. + If not set, the dtype will be inferred based on the first non-null value + that is returned by the function. skip_nulls Don't map the function over values that contain nulls (this is faster). pass_name diff --git a/py-polars/polars/series/series.py b/py-polars/polars/series/series.py index 0a27569b5d3f..29e14f004e94 100644 --- a/py-polars/polars/series/series.py +++ b/py-polars/polars/series/series.py @@ -5271,8 +5271,9 @@ def map_elements( function Custom function or lambda. return_dtype - Output datatype. If none is given, the same datatype as this Series will be - used. + Output datatype. + If not set, the dtype will be inferred based on the first non-null value + that is returned by the function. skip_nulls Nulls will be skipped and not passed to the python function. This is faster because python can be skipped and because we call