Skip to content

BUG: Pandas changes dtypes of columns when no float (or other) assignments are done to this column #34573 #34599

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

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins added Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves labels Jun 5, 2020
@@ -1844,7 +1844,8 @@ def _setitem_with_indexer_missing(self, indexer, value):
if len(value) != len(self.obj.columns):
raise ValueError("cannot set a row with mismatched columns")

value = Series(value, index=self.obj.columns, name=indexer)
dtype = object if isinstance(value, dict) else None
Copy link
Contributor

Choose a reason for hiding this comment

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

i would integrate this with the if clause above

Copy link
Contributor

Choose a reason for hiding this comment

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

or rather the if/else on L1840

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 + green

@jreback jreback added this to the 1.1 milestone Jun 9, 2020
@jreback jreback merged commit a7c9877 into pandas-dev:master Jun 9, 2020
@jreback
Copy link
Contributor

jreback commented Jun 9, 2020

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the df-setitem-with-dict-changing-dtypes branch June 10, 2020 08:04
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 Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Pandas changes dtypes of columns when no float (or other) assignments are done to this column
2 participants