Skip to content
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

Updating the shrink keyword functionality in masked_values (Trac #2082) #2674

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 0 comments · Fixed by #6538
Closed

Updating the shrink keyword functionality in masked_values (Trac #2082) #2674

numpy-gitbot opened this issue Oct 19, 2012 · 0 comments · Fixed by #6538

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/2082 on 2012-03-15 by trac user gsever, assigned to @pierregm.

Considering this simple case:

x = np.array([1, 1.1, 2, 1.1, 3])

ma.masked_values(x, 1.5)
masked_array(data = [ 1.   1.1  2.   1.1  3. ],
      mask = False,
      fill_value=1.5)

ma.masked_values(x, 1.5, shrink=False)
masked_array(data = [ 1.   1.1  2.   1.1  3. ],
      mask = False,
      fill_value=1.5)

Setting the 'shrink' keyword to False should create a mask with False filled array provided the condition is not met. The improved shrink keyword handling should yield the following masked array.

ma.masked_values(x, 1.5, shrink=False)
masked_array(data = [1.0 1.1 2.0 1.1 3.0],
             mask = [False False False False False],
       fill_value = 1.5)

The documentation about masked_values is at:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.masked_values.html

jjhelmus added a commit to jjhelmus/numpy that referenced this issue Oct 21, 2015
When called with the shrink parameter set to False, np.ma.masked_values
will create a False filled array mask and not shrink the mask.
Previously the mask would be shrunk to a single False scalar.

closes numpy#2674
charris pushed a commit to charris/numpy that referenced this issue Oct 21, 2015
When called with the shrink parameter set to False, np.ma.masked_values
will create a False filled array mask and not shrink the mask.
Previously the mask would be shrunk to a single False scalar.

closes numpy#2674
jaimefrio pushed a commit to jaimefrio/numpy that referenced this issue Mar 22, 2016
When called with the shrink parameter set to False, np.ma.masked_values
will create a False filled array mask and not shrink the mask.
Previously the mask would be shrunk to a single False scalar.

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

Successfully merging a pull request may close this issue.

1 participant