Permalink
Browse files

Don't reset the fill_value of a MaskedArray when calling view() with …

…no dtype
  • Loading branch information...
1 parent 526b764 commit 3e99f32b8e32fcb7bd16c7c4a3163e778d07cdc6 @astrofrog astrofrog committed Oct 31, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 numpy/ma/core.py
View
@@ -2882,7 +2882,10 @@ def view(self, dtype=None, type=None):
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__

0 comments on commit 3e99f32

Please sign in to comment.