diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2016-02-04 20:39:43 +0100 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2016-03-01 19:44:04 +0100 |
commit | ed083cffe0c2dd6ebf42d418dddc71848b67800e (patch) | |
tree | ac030306cb21ad345ddde6283ad62c683abf396a /numpy/ma/extras.py | |
parent | 386639363233165bcba1f1ba7b10aff3c40d46b3 (diff) | |
download | numpy-ed083cffe0c2dd6ebf42d418dddc71848b67800e.tar.gz |
ENH: Make no unshare mask future warnings less noisy
Incorporates Nathaniels suggestions for a longer explanation
in the release notes.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 9855b4e76..6e091652e 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -689,6 +689,7 @@ def median(a, axis=None, out=None, overwrite_input=False): # insert indices of low and high median ind.insert(axis, h - 1) low = asorted[ind] + low._sharedmask = False ind[axis] = h high = asorted[ind] # duplicate high if odd number of elements so mean does nothing @@ -1173,9 +1174,9 @@ def _covhelper(x, y=None, rowvar=True, allow_masked=True): # Define some common mask common_mask = np.logical_or(xmask, ymask) if common_mask is not nomask: - x.unshare_mask() - y.unshare_mask() xmask = x._mask = y._mask = ymask = common_mask + x._sharedmask = False + y._sharedmask = False x = ma.concatenate((x, y), axis) xnotmask = np.logical_not(np.concatenate((xmask, ymask), axis)).astype(int) x -= x.mean(axis=rowvar)[tup] @@ -1326,6 +1327,7 @@ def corrcoef(x, y=None, rowvar=True, bias=np._NoValue, allow_masked=True, _denom = ma.sqrt(ma.multiply.outer(diag, diag)) else: _denom = diagflat(diag) + _denom._sharedmask = False # We know return is always a copy n = x.shape[1 - rowvar] if rowvar: for i in range(n - 1): |