summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2023-02-28 19:38:45 +0000
committerRalf Gommers <ralf.gommers@gmail.com>2023-02-28 23:15:40 +0000
commit768bbec24fff74cb59a173accf7fbeda6aca89a1 (patch)
tree041b801d111834c5e16b543d82482af5305f6d19 /numpy/core/fromnumeric.py
parent486878b37fc7439a3b2b87747f50db9b62fea8eb (diff)
downloadnumpy-768bbec24fff74cb59a173accf7fbeda6aca89a1.tar.gz
DEP: deprecate `np.round_`
Closes gh-22617
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 7d3336f88..96f585066 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -21,7 +21,7 @@ __all__ = [
'argmin', 'argpartition', 'argsort', 'around', 'choose', 'clip',
'compress', 'cumprod', 'cumproduct', 'cumsum', 'diagonal', 'mean',
'ndim', 'nonzero', 'partition', 'prod', 'product', 'ptp', 'put',
- 'ravel', 'repeat', 'reshape', 'resize', 'round_',
+ 'ravel', 'repeat', 'reshape', 'resize', 'round', 'round_',
'searchsorted', 'shape', 'size', 'sometrue', 'sort', 'squeeze',
'std', 'sum', 'swapaxes', 'take', 'trace', 'transpose', 'var',
]
@@ -3337,6 +3337,9 @@ def around(a, decimals=0, out=None):
return _wrapfunc(a, 'round', decimals=decimals, out=out)
+round = around
+
+
def _mean_dispatcher(a, axis=None, dtype=None, out=None, keepdims=None, *,
where=None):
return (a, where, out)
@@ -3760,10 +3763,17 @@ def round_(a, decimals=0, out=None):
`~numpy.round_` is a disrecommended backwards-compatibility
alias of `~numpy.around` and `~numpy.round`.
+ .. deprecated:: 1.25.0
+ ``round_`` is deprecated as of NumPy 1.25.0, and will be
+ removed in NumPy 2.0. Please use `round` instead.
+
See Also
--------
around : equivalent function; see for details.
"""
+ warnings.warn("`round_` is deprecated as of NumPy 1.25.0, and will be "
+ "removed in NumPy 2.0. Please use `round` instead.",
+ DeprecationWarning, stacklevel=2)
return around(a, decimals=decimals, out=out)