From b957d53aa6d835e5c456bc98943cde960658633d Mon Sep 17 00:00:00 2001 From: Marshall Date: Tue, 12 Mar 2024 17:20:22 -0400 Subject: [PATCH] docs(python): Fix inadvertent swap of `new` and `old` parameters in `replace` description (#15019) --- py-polars/polars/expr/expr.py | 2 +- py-polars/polars/series/series.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.