diff options
author | Thomas Robitaille <thomas.robitaille@gmail.com> | 2012-10-31 19:57:15 +0100 |
---|---|---|
committer | Thomas Robitaille <thomas.robitaille@gmail.com> | 2012-10-31 19:57:15 +0100 |
commit | 3e99f32b8e32fcb7bd16c7c4a3163e778d07cdc6 (patch) | |
tree | bde5e1ac1fcf9d53b0d9ee7279dfd6f482438cd7 /numpy/ma | |
parent | 526b7647ad3e0c295340e7b85593364eeadc5686 (diff) | |
download | numpy-3e99f32b8e32fcb7bd16c7c4a3163e778d07cdc6.tar.gz |
Don't reset the fill_value of a MaskedArray when calling view() with no dtype
Diffstat (limited to 'numpy/ma')
-rw-r--r-- | numpy/ma/core.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index a7e04cd13..a683e4151 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2882,7 +2882,10 @@ class MaskedArray(ndarray): pass # Make sure to reset the _fill_value if needed if getattr(output, '_fill_value', None) is not None: - output._fill_value = None + if dtype is None: + pass # leave _fill_value as is + else: + output._fill_value = None return output view.__doc__ = ndarray.view.__doc__ |