-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
bug in nansum with non-float64 dtypes #6209
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
Comments
Maybe, although there are no nans in the last two examples. Nansum only looks for nans in floating types as those are the only types that have nans. |
Yeah, I'm not sure what to make of the object dtype case either -- it's not
|
just thinking for consistency, a bit unexpected for the function to do different things depending on the dtype ideally I'd like to match you in |
can you put a pointer to the original motivation for this change. |
@jreback you mean the change that nansum will not return NaN? I think we decided it seemed more right when chuck did some cleanup of the NaN stuff, there is actually a FutureWarning in place for it in NumPy 1.8. |
@seberg ok i c. was their an original issue / discussion? |
A bit hard to find, I think it can be traced back to this discussion (just a random mail from it, it is quite long): http://mail.scipy.org/pipermail/numpy-discussion/2013-July/067160.html |
Previous discussion on related issue: #1721. |
@jreback Want to keep this open? |
you guys had lots of discussion in #1721 about the behavior of but assuming that you like the behavior for floats. I certainly think this should be consistent across dtypes (that are summable), e.g. |
Uh oh!
There was an error while loading. Please reload this page.
These non-float
nansum's
are a little suspectxref pandas-dev/pandas#10815
Summary 2019-05-03 by @seberg
The second example now actually returns 0 as well, since objects use
arr != arr
to guess if NaNs exist. Timedelta NaT are still not considered NaN fornanfuncs
, which may still be up for discussion.The text was updated successfully, but these errors were encountered: