-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Sum/product of empty object array is False/True #10639
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
Duplicate of #8860
This is fixed in #8952 (master), which now causes your example to return However, |
Should it be the long term goal to get rid of identies for object arrays assuming we have an identity/default kwarg? |
What's the status here? Do we think |
Well, we have an With a good reason, pretty much only useful for I do not think we currently plan on a deprecation to force |
The examples shown above are all working now:
I'm closing the issue, but if there are still problems lurking here, we can reopen or start a new issue. |
This strange behavior came up in pandas-dev/pandas#19813:
It's almost as if NumPy picks a dtype at random (e.g., bool in this case) to use for computing the result. A more obviously and likely more consistent choice would be to use the identities for the appropriate ufuncs (i.e.,
np.add.identity
andnp.mul.identity
), which are the integers0
and1
, respectively.The text was updated successfully, but these errors were encountered: