diff options
| author | Eric Wieser <wieser.eric@gmail.com> | 2017-07-18 15:40:30 +0100 |
|---|---|---|
| committer | Eric Wieser <wieser.eric@gmail.com> | 2017-07-18 15:45:32 +0100 |
| commit | 36f481ba4f1610cc8ac3e04d73d253e0c0231b58 (patch) | |
| tree | 2c14528b364e2e13f76cff9e92551cad188eaeb7 /numpy/ma/core.py | |
| parent | de29dc52ef7d84534471604c901e4de07d8c6073 (diff) | |
| download | numpy-36f481ba4f1610cc8ac3e04d73d253e0c0231b58.tar.gz | |
BUG: change fix for gh-9328 to make masked.copy() a noop
Diffstat (limited to 'numpy/ma/core.py')
| -rw-r--r-- | numpy/ma/core.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 472b04429..a06971d6a 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -6253,6 +6253,12 @@ class MaskedConstant(MaskedArray): __iop__ del __iop__ # don't leave this around + def copy(self, *args, **kwargs): + """ Copy is a no-op on the maskedconstant, as it is a scalar """ + # maskedconstant is a scalar, so copy doesn't need to copy. There's + # precedent for this with `np.bool_` scalars. + return self + masked = masked_singleton = MaskedConstant() masked_array = MaskedArray |
