Skip to content

ENH: Don't fragment manager if convert is no-op #53977

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 2 commits into from
Jul 3, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Jul 2, 2023

cc @jbrockmendel thoughts here? This isn't ideal but since this is probably the code path that's taken 99% of the time this might make sense?

@@ -1592,3 +1592,10 @@ def test_replace_categorical_no_replacement(self):

result = df.replace(to_replace=[".", "def"], value=["_", None])
tm.assert_frame_equal(result, expected)

def test_replace_object_splitting(self):
# GH#
Copy link
Member

Choose a reason for hiding this comment

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

gh ref

Copy link
Member Author

Choose a reason for hiding this comment

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

thx

@phofl phofl added Performance Memory or execution speed performance replace replace method labels Jul 3, 2023
@phofl phofl added this to the 2.1 milestone Jul 3, 2023
@phofl
Copy link
Member Author

phofl commented Jul 3, 2023

This feels a bit too deep in the internals for a whatsnew

@phofl phofl merged commit 866a388 into pandas-dev:main Jul 3, 2023
@phofl phofl deleted the fragmented_convert branch July 3, 2023 20:07
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance replace replace method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: df.replace(regex=True) causes highly fragmented DataFrame
2 participants