summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-02-28 01:05:02 +0000
committerGitHub <noreply@github.com>2017-02-28 01:05:02 +0000
commitee3ab365cb55cce6d0b9b6ed5cfbd8e3ede8cc66 (patch)
tree3954c44d0f6035645f601af3a0f7b8debba95608
parente58c6adc591e47675192ecfc584dad54a00cf401 (diff)
parentd0bf15d1b99dd239530b25a0d939ee4475f85af5 (diff)
downloadnumpy-ee3ab365cb55cce6d0b9b6ed5cfbd8e3ede8cc66.tar.gz
Merge pull request #8669 from MSeifert04/partition_warning
MAINT: Warn users when calling np.ma.MaskedArray.partition function.
-rw-r--r--numpy/ma/core.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index af8a523ab..ea4a1d85f 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5635,6 +5635,18 @@ class MaskedArray(ndarray):
np.subtract(out, min_value, out=out, casting='unsafe')
return out
+ def partition(self, *args, **kwargs):
+ warnings.warn("Warning: 'partition' will ignore the 'mask' "
+ "of the {}.".format(self.__class__.__name__),
+ stacklevel=2)
+ return super(MaskedArray, self).partition(*args, **kwargs)
+
+ def argpartition(self, *args, **kwargs):
+ warnings.warn("Warning: 'argpartition' will ignore the 'mask' "
+ "of the {}.".format(self.__class__.__name__),
+ stacklevel=2)
+ return super(MaskedArray, self).argpartition(*args, **kwargs)
+
def take(self, indices, axis=None, out=None, mode='raise'):
"""
"""