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

ENH: Fixed issue that occurs when trying to take the median of a list of masked arrays. issue #10757 #10909

Closed
wants to merge 1 commit into from

Conversation

jsclose
Copy link
Contributor

@jsclose jsclose commented Apr 15, 2018

Fixed issue that occurs when trying to take the median of a list of masked arrays.
Added a check to see if the input is a list then converts to a masked array.
See issue #10757 for more information.

Fixed issue that occurs when trying to take the median of a list of masked arrays.
Added a check to see if the input is a list then converts to a masked array.
See issue numpy#10757 for more information.
@jsclose jsclose changed the title ENH: ENH: Fixed issue that occurs when trying to take the median of a list of masked arrays. issue #10757 Apr 15, 2018
@mattip
Copy link
Member

mattip commented Apr 16, 2018

Does this issue occur in other ma methods that need to check for a list?

@eric-wieser
Copy link
Member

It feels like there ought to be a better solution to this.

@eric-wieser
Copy link
Member

eric-wieser commented Apr 17, 2018

Ok, so a better fix would be

  • Use a = np.ma.asarray(a) unconditionally (also handles tuples and other sequences in a predictable way)
  • Replace not hasattr(a, 'mask') with a.mask is np.nomask

Base automatically changed from master to main March 4, 2021 02:04
@InessaPawson
Copy link
Member

@jsclose, thank you for trying to fix #10757! Do you think you could finish this PR some time soon?

@bsipocz
Copy link
Member

bsipocz commented Jul 16, 2022

Thank you @jsclose for the PR.

PR #21999 rebased this PR (your commit from here got moved over and will get the author credit) and I applied the changes suggested in the review from above. I'm closing this now.

@bsipocz bsipocz closed this Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants