diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index e0487c6ee99c..9c856438623b 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -9263,7 +9263,7 @@ def replace( Accepts expression input. Sequences are parsed as Series, other non-expression inputs are parsed as literals. Also accepts a mapping of values to their replacement as syntactic sugar for - `replace(new=Series(mapping.keys()), old=Series(mapping.values()))`. + `replace(old=Series(mapping.keys()), new=Series(mapping.values()))`. new Value or sequence of values to replace by. Accepts expression input. Sequences are parsed as Series, diff --git a/py-polars/polars/series/series.py b/py-polars/polars/series/series.py index 6a1e9c4f127f..11a7dcf1d72c 100644 --- a/py-polars/polars/series/series.py +++ b/py-polars/polars/series/series.py @@ -6584,7 +6584,7 @@ def replace( old Value or sequence of values to replace. Also accepts a mapping of values to their replacement as syntactic sugar for - `replace(new=Series(mapping.keys()), old=Series(mapping.values()))`. + `replace(old=Series(mapping.keys()), new=Series(mapping.values()))`. new Value or sequence of values to replace by. Length must match the length of `old` or have length 1.