Skip to content

BUG: Many ndarray methods are not specialized for ma.MaskedArray #4356

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

Open
abalkin opened this issue Feb 24, 2014 · 0 comments
Open

BUG: Many ndarray methods are not specialized for ma.MaskedArray #4356

abalkin opened this issue Feb 24, 2014 · 0 comments

Comments

@abalkin
Copy link
Contributor

abalkin commented Feb 24, 2014

Since ma.MaskedArray inherits from ndarray, all ndarray methods are inherited, but with exception of ufuncs, such inheritance is ill-advised and may lead to silent data corruption:

>>> x = ma.masked_all(5)
>>> x.item(0)
-1.2882297539194267e-231

The list of such methods includes:

  1. choose
  2. dumps
  3. dump
  4. item
  5. partition
  6. argpartition
  7. fill
  8. searchsorted
  9. dot

I would classify this issue as a bug, but a fix can be as simple as making these methods raise NotImplementedError.

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

No branches or pull requests

3 participants