Skip to content

BUG&TST: df.replace fail after converting to new dtype #31545

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 10 commits into from
Feb 1, 2020

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Feb 1, 2020

@charlesdong1991
Copy link
Member Author

This was solved by #31484 and here add a test to prove it works now, and thus close the issue, i think a whatsnew is not needed in this case


def test_replace_after_convert_dtypes(self):
# GH31517
df = pd.DataFrame({"grp": [1, 2, 3, 4, 5]})
Copy link
Member

Choose a reason for hiding this comment

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

I would just specify it here as dtype="Int64" instead of using convert_dtypes (in the end, the issue was that replace didn't work with Int64 data, the convert_dtypes was just a way to get such dtype)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yeah, i was copying-pasting the example in issue description, sorry for my laziness. 😅 changed!

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Feb 1, 2020
@jreback jreback added this to the 1.0.1 milestone Feb 1, 2020
@jreback jreback merged commit 5b0fefa into pandas-dev:master Feb 1, 2020
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Feb 1, 2020
@jreback
Copy link
Contributor

jreback commented Feb 1, 2020

thanks @charlesdong1991

backporting this to ensure that 1.0.x is tested as well.

jreback pushed a commit to jreback/pandas that referenced this pull request Feb 2, 2020
jreback added a commit that referenced this pull request Feb 2, 2020
…dtype (#31584)

Co-authored-by: Kaiqi Dong <kaiqidong1991@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.DataFrame.replace doesn't work after converting to new dtypes in 1.0.0
3 participants