summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 40b38e01a..ca735cbc2 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -6739,7 +6739,7 @@ add_newdoc('numpy.core.multiarray', 'busday_count',
add_newdoc('numpy.core.multiarray', 'normalize_axis_index',
"""
- normalize_axis_index(axis, ndim)
+ normalize_axis_index(axis, ndim, msg_prefix=None)
Normalizes an axis index, `axis`, such that is a valid positive index into
the shape of array with `ndim` dimensions. Raises an AxisError with an
@@ -6756,6 +6756,8 @@ add_newdoc('numpy.core.multiarray', 'normalize_axis_index',
ndim : int
The number of dimensions of the array that `axis` should be normalized
against
+ msg_prefix : str
+ A prefix to put before the message, typically the name of the argument
Returns
-------
@@ -6780,6 +6782,10 @@ add_newdoc('numpy.core.multiarray', 'normalize_axis_index',
Traceback (most recent call last):
...
AxisError: axis 3 is out of bounds for array of dimension 3
+ >>> normalize_axis_index(-4, ndim=3, msg_prefix='axes_arg')
+ Traceback (most recent call last):
+ ...
+ AxisError: axes_arg: axis -4 is out of bounds for array of dimension 3
""")
##############################################################################