Skip to content

BUG: convert_dtypes not converting with pd.NA and object dtype #48857

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 3 commits into from
Sep 29, 2022

Conversation

phofl
Copy link
Member

@phofl phofl commented Sep 29, 2022

I think these conversion rules make more sense

@phofl phofl added Dtype Conversions Unexpected or buggy dtype conversions NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Sep 29, 2022
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

So to confirm, inferred_dtype='floating' is not applicable here?

@phofl
Copy link
Member Author

phofl commented Sep 29, 2022

I wondered the same thing. As soon as NA is present, we get mixed. Otherwise we don't end up there

@mroeschke mroeschke added this to the 1.6 milestone Sep 29, 2022
@mroeschke mroeschke merged commit 7ab6a10 into pandas-dev:main Sep 29, 2022
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the 48791 branch September 30, 2022 07:55
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…s-dev#48857)

* BUG: convert_dtypes not converting with pd.NA and object dtype

* Add doc

* Fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: convert_dtypes() leaves int + pd.NA Series as object instead of converting to Int64
2 participants