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
Odd behavior of ma.add.reduce on boolean arrays #7623
Comments
Hmm, looks like this might be a problem in ndarray also
|
@charris - the ndarray behavior that you show seems to follow naturally from the definition of addition on booleans: basically "add" means "or". Not the best, but it is what it is. What do you see as a bug in your display? |
The issue that I am reporting here is ma specific. Take a look at this if statement in the definition of |
@abalkin The reference was to the fact that addition results in a boolean, but reduction returns and integer. That is an inconsistancy. I suspect both should return integer for addition, as a lot of code adds up the booleans for counting purposes, while, if the logical form is needed, |
@charris - this is documented for
Maybe we should document an exception for the reduce as well. |
Consider two masked arrays:
The only difference is that one has an all-false mask and the other has
mask=nomask
. However,ma.add.reduce
returns different values:The text was updated successfully, but these errors were encountered: