Skip to content

DEPR: downcasting in replace #54710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
suppress doc warnings
  • Loading branch information
jbrockmendel committed Aug 23, 2023
commit edf42219a07d4529708d5affc72c5104184b521c
2 changes: 2 additions & 0 deletions doc/source/user_guide/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ Pass nested dictionaries of regular expressions that use the ``regex`` keyword.
Pass a list of regular expressions that will replace matches with a scalar.

.. ipython:: python
:okwarning:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these examples be changed to not produce a warning?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to not produce warning + green


df.replace([r"\s*\.\s*", r"a|b"], np.nan, regex=True)

Expand All @@ -668,6 +669,7 @@ argument must be passed explicitly by name or ``regex`` must be a nested
dictionary.

.. ipython:: python
:okwarning:

df.replace(regex=[r"\s*\.\s*", r"a|b"], value=np.nan)

Expand Down