Skip to content

Masked arrays: keepdims is not enforced in numpy.ma.amax #7720

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

Closed
ycopin opened this issue Jun 9, 2016 · 7 comments
Closed

Masked arrays: keepdims is not enforced in numpy.ma.amax #7720

ycopin opened this issue Jun 9, 2016 · 7 comments

Comments

@ycopin
Copy link

ycopin commented Jun 9, 2016

The keepdims option is not enforced in fonction numpy.ma.amax:

>>> import numpy
>>> x = numpy.random.randn(4, 3)
>>> numpy.amax(x, axis=-1, keepdims=True).shape
(4, 1)
>>> numpy.ma.amax(numpy.ma.masked_array(x), axis=-1, keepdims=True).shape
(4,)
@seberg
Copy link
Member

seberg commented Jun 11, 2016

Thanks for the report. Ignoring of keepdims in the ma code has recently been fixed (I am not quite sure whether it is fixed in 1.11 or only will be in 1.12 though). Anyway this works now, probably update to 1.11 is good enough.

@seberg seberg closed this as completed Jun 11, 2016
@ycopin
Copy link
Author

ycopin commented Jun 12, 2016

Thanks for the feedback. FYI, I was using latest pip-available numpy 1.11.0.

@charris
Copy link
Member

charris commented Jun 12, 2016

Hmm, not fixed in 1.11.1rc1. Looks like 75ae820 fixed it. #4619.

@seberg
Copy link
Member

seberg commented Jun 12, 2016

I would leave it I think, IIRC, it was quite a complex piece of
changes.

@charris
Copy link
Member

charris commented Jun 12, 2016

I went ahead with the backport, #7736, the cherry-pick was clean and a lot of the changes just reformatted docstrings.

@charris
Copy link
Member

charris commented Jun 13, 2016

Well, that actually didn't fix the masked array problem, but now it raises an error ;)

@charris
Copy link
Member

charris commented Jun 13, 2016

Bisect shows #5706 to have the good stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants