summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2014-01-28 21:48:34 +0200
committerPauli Virtanen <pav@iki.fi>2014-01-28 21:49:57 +0200
commita258e3cfbd28fb48722c5c83999f6910ef8d827a (patch)
treef1d285b26018f07d78ad01c58cbb810f9e4b96dc /numpy/add_newdocs.py
parent05b236430617dfc6003f60b513c072870d577b2a (diff)
downloadnumpy-a258e3cfbd28fb48722c5c83999f6910ef8d827a.tar.gz
DOC: fix error in reduceat documentation
reduceat does not allow out-of-bounds indices currently
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 238c17ba7..3e115c845 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -5686,12 +5686,13 @@ add_newdoc('numpy.core', 'ufunc', ('reduceat',
``ufunc.reduce(a[indices[i]:indices[i+1]])``, which becomes the i-th
generalized "row" parallel to `axis` in the final result (i.e., in a
2-D array, for example, if `axis = 0`, it becomes the i-th row, but if
- `axis = 1`, it becomes the i-th column). There are two exceptions to this:
+ `axis = 1`, it becomes the i-th column). There are three exceptions to this:
- * when ``i = len(indices) - 1`` (so for the last index),
- ``indices[i+1] = a.shape[axis]``.
- * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
- simply ``a[indices[i]]``.
+ * when ``i = len(indices) - 1`` (so for the last index),
+ ``indices[i+1] = a.shape[axis]``.
+ * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
+ simply ``a[indices[i]]``.
+ * if ``indices[i] >= len(a)`` or ``indices[i] < 0``, an error is raised.
The shape of the output depends on the size of `indices`, and may be
larger than `a` (this happens if ``len(indices) > a.shape[axis]``).