-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Series dtype changes when a new row is added #21501
Comments
|
Sorry misunderstood this on first glance. I see now that the append of None coerces to object but assigning to an existing value preserves type, automatically converting None to Investigation and PRs into the behavior are certainly welcome |
@WillAyd Don't worry, my fault, I should have gone into more detail. What would be the expected behavior? My opinion: On the one hand, On the other hand, if the field already exists, both ( From your first answer I understand that the first is what is expected and the second is not, that is, if a field exists and the content is changed to |
I think any insert or assignment of cc @TomAugspurger @jreback if they disagree |
there is an issue about this already iirc |
Probably this issue: #20442 (comment) |
All of these now return |
The problem
If we create a
Series
with a defineddtype
and then a new row is added into thatSeries
thedtype
changes. I have left an example below:Example
However, this doesn't happen when the row is already present:
The text was updated successfully, but these errors were encountered: