diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2021-11-19 22:02:04 +0100 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2021-11-21 17:34:30 +0100 |
commit | 99d5308c6f7f0eeed34511a311e64172bd97623f (patch) | |
tree | 6085a5a0df70173ba132a979184458a5db6c0753 /numpy/core/fromnumeric.py | |
parent | d1e711fcb0d8132d607698889db6de6c3adedd8d (diff) | |
download | numpy-99d5308c6f7f0eeed34511a311e64172bd97623f.tar.gz |
DEP: remove deprecated `np.alen` function
Was deprecated in 1.18.0
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 3242124ac..6858fbc6d 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -17,7 +17,7 @@ _dt_ = nt.sctype2char # functions that are methods __all__ = [ - 'alen', 'all', 'alltrue', 'amax', 'amin', 'any', 'argmax', + 'all', 'alltrue', 'amax', 'amin', 'any', 'argmax', 'argmin', 'argpartition', 'argsort', 'around', 'choose', 'clip', 'compress', 'cumprod', 'cumproduct', 'cumsum', 'diagonal', 'mean', 'ndim', 'nonzero', 'partition', 'prod', 'product', 'ptp', 'put', @@ -2917,51 +2917,6 @@ def amin(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue, keepdims=keepdims, initial=initial, where=where) -def _alen_dispathcer(a): - return (a,) - - -@array_function_dispatch(_alen_dispathcer) -def alen(a): - """ - Return the length of the first dimension of the input array. - - .. deprecated:: 1.18 - `numpy.alen` is deprecated, use `len` instead. - - Parameters - ---------- - a : array_like - Input array. - - Returns - ------- - alen : int - Length of the first dimension of `a`. - - See Also - -------- - shape, size - - Examples - -------- - >>> a = np.zeros((7,4,5)) - >>> a.shape[0] - 7 - >>> np.alen(a) - 7 - - """ - # NumPy 1.18.0, 2019-08-02 - warnings.warn( - "`np.alen` is deprecated, use `len` instead", - DeprecationWarning, stacklevel=2) - try: - return len(a) - except TypeError: - return len(array(a, ndmin=1)) - - def _prod_dispatcher(a, axis=None, dtype=None, out=None, keepdims=None, initial=None, where=None): return (a, out) |