Skip to content

ENH: Add CoW mechanism to replace_regex #51669

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 6 commits into from
Mar 1, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Feb 27, 2023

This was actually buggy as well

@phofl phofl requested a review from lithomas1 February 27, 2023 10:48
@phofl phofl added this to the 2.0 milestone Feb 27, 2023
def test_replace_regex_inplace(using_copy_on_write):
df = DataFrame({"a": ["aaa", "bbb"]})
arr = get_array(df, "a")
df.replace(to_replace=r"^a.$", value="new", inplace=True, regex=True)
Copy link
Member

Choose a reason for hiding this comment

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

This is a no-op?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah thanks for noticing, there was a * missing

@lithomas1 lithomas1 merged commit cb04202 into pandas-dev:main Mar 1, 2023
@lithomas1
Copy link
Member

thanks @phofl

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Mar 1, 2023
@phofl phofl deleted the cow_replace_regex branch March 1, 2023 12:32
phofl added a commit that referenced this pull request Mar 1, 2023
…_regex) (#51713)

Backport PR #51669: ENH: Add CoW mechanism to replace_regex

Co-authored-by: Patrick Hoefler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants