10000 Merge pull request #4238 from pv/reduceat-doc · numpy/numpy@c159cb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c159cb0

Browse files
committed
Merge pull request #4238 from pv/reduceat-doc
DOC: fix error in reduceat documentation
2 parents 05b2364 + a258e3c commit c159cb0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

numpy/add_newdocs.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5686,12 +5686,13 @@ def luf(lamdaexpr, *args, **kwargs):
56865686
``ufunc.reduce(a[indices[i]:indices[i+1]])``, which becomes the i-th
56875687
generalized "row" parallel to `axis` in 917C the final result (i.e., in a
56885688
2-D array, for example, if `axis = 0`, it becomes the i-th row, but if
5689-
`axis = 1`, it becomes the i-th column). There are two exceptions to this:
5689+
`axis = 1`, it becomes the i-th column). There are three exceptions to this:
56905690
5691-
* when ``i = len(indices) - 1`` (so for the last index),
5692-
``indices[i+1] = a.shape[axis]``.
5693-
* if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
5694-
simply ``a[indices[i]]``.
5691+
* when ``i = len(indices) - 1`` (so for the last index),
5692+
``indices[i+1] = a.shape[axis]``.
5693+
* if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
5694+
simply ``a[indices[i]]``.
5695+
* if ``indices[i] >= len(a)`` or ``indices[i] < 0``, an error is raised.
56955696
56965697
The shape of the output depends on the size of `indices`, and may be
56975698
larger than `a` (this happens if ``len(indices) > a.shape[axis]``).

0 commit comments

Comments
 (0)
0