-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG: Pandas changes dtypes of columns when no float (or other) assignments are done to this column #34573 #34599
Conversation
…ments are done to this column pandas-dev#34573
…ict-changing-dtypes
pandas/core/indexing.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated + green
thanks @simonjayhawkins |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff