summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-04-13 14:00:51 +0100
committerEric Wieser <wieser.eric@gmail.com>2017-05-06 01:29:29 +0100
commit588448c99922868cbdb52eaf01e8702a03455d77 (patch)
tree7e0acee8d145b6784ebed39de7590d21c19ad1dc
parent6153a705c3bf30992ff5bd064ff0507ac78300e4 (diff)
downloadnumpy-588448c99922868cbdb52eaf01e8702a03455d77.tar.gz
DEP: Deprecate np.ma.MaskedArray.mini
This was untested, and the documentation did not mention how it differed from `min` anyway. Fixes #8764
-rw-r--r--doc/release/1.13.0-notes.rst4
-rw-r--r--numpy/ma/core.py22
2 files changed, 25 insertions, 1 deletions
diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst
index 2f32ddb28..52f664b28 100644
--- a/doc/release/1.13.0-notes.rst
+++ b/doc/release/1.13.0-notes.rst
@@ -31,7 +31,9 @@ Deprecations
* ``np.ma.argsort`` should be called with an explicit `axis` argument when
applied to arrays with more than 2 dimensions, as the default value of
this argument (``None``) is inconsistent with the rest of numpy (``-1``).
-
+* ``np.ma.MaskedArray.mini`` is deprecated, as it almost duplicates the
+ functionality of ``np.MaskedArray.min``. Exactly equivalent behaviour
+ can be obtained with ``np.ma.minimum.reduce``.
Build System Changes
====================
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 20cc77bc4..8861a3464 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5621,6 +5621,14 @@ class MaskedArray(ndarray):
"""
Return the array minimum along the specified axis.
+ .. deprecated:: 1.13.0
+ This function is identical to both:
+
+ * ``self.min(keepdims=True, axis=axis).squeeze(axis=axis)``
+ * ``np.ma.minimum.reduce(self, axis=axis)``
+
+ Typically though, ``self.min(axis=axis)`` is sufficient.
+
Parameters
----------
axis : int, optional
@@ -5650,7 +5658,21 @@ class MaskedArray(ndarray):
>>> print(x.mini(axis=1))
[0 2 4]
+ There is a small difference between `mini` and `min`:
+
+ >>> x[:,1].mini(axis=0)
+ masked_array(data = --,
+ mask = True,
+ fill_value = 999999)
+ >>> x[:,1].min(axis=0)
+ masked
"""
+
+ # 2016-04-13, 1.13.0, gh-8764
+ warnings.warn(
+ "`mini` is deprecated; use the `min` method or "
+ "`np.ma.minimum.reduce instead.",
+ DeprecationWarning, stacklevel=2)
if axis is None:
return minimum(self)
else: