-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fillna overwriting other missing vals #40509
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
mzeitlin11
commented
Mar 19, 2021
- closes BUG: Series.fillna is altering None values of unspecified columns #40498
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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 am not sure i buy that this is a bug at all.
In [149]: series.isna()
Out[149]:
1 False
2 True
3 True
4 False
dtype: bool
Trying to use mixed null values in an object
series is just not supported.
I think the confusion from #40498 is not that |
I am ok with that, but your patch is not structured that way. it shouldn't be testing for nulls |
Sorry, can you please clarify what you mean by that? What the patch should be doing is fixing the following: for the series When this hits To avoid having to change the behavior of lower level |
@@ -6524,6 +6524,11 @@ def fillna( | |||
value, dtype_if_empty=object | |||
) | |||
value = value.reindex(self.index, copy=False) | |||
|
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 think you are better off calling .align here. What you have on L6531 is too specific, fragile and trying to fix something after the fact.
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.
Yeah I see what you mean. Not seeing a clear solution with .align either - will have to have some sort of ugly isna check at some point I think to support this. Will close for now and reopen if I can find a better way to do this