diff options
author | Guilherme Leobas <guilhermeleobas@gmail.com> | 2020-05-11 14:09:42 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 20:09:42 +0300 |
commit | 9ff05dc5d5afd4e801f1acf27b33ca2ed74c48f8 (patch) | |
tree | 711d96b690b400eaa7aa09060b396a1c735ba1ab | |
parent | ae821835fdb8732aa2bb4ff10f45fb7981fb92ff (diff) | |
download | numpy-9ff05dc5d5afd4e801f1acf27b33ca2ed74c48f8.tar.gz |
DOC: Update np.rollaxis docstring (#15939)
* DOC: Update np.rollaxis docstring to correct parameter explanation
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
-rw-r--r-- | numpy/core/numeric.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 17b435c74..40c7a6ae6 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1229,11 +1229,39 @@ def rollaxis(a, axis, start=0): a : ndarray Input array. axis : int - The axis to roll backwards. The positions of the other axes do not + The axis to be rolled. The positions of the other axes do not change relative to one another. start : int, optional - The axis is rolled until it lies before this position. The default, - 0, results in a "complete" roll. + When ``start <= axis``, the axis is rolled back until it lies in + this position. When ``start > axis``, the axis is rolled until it + lies before this position. The default, 0, results in a "complete" + roll. The following table describes how negative values of ``start`` + are interpreted: + + .. table:: + :align: left + + +-------------------+----------------------+ + | ``start`` | Normalized ``start`` | + +===================+======================+ + | ``-(arr.ndim+1)`` | raise ``AxisError`` | + +-------------------+----------------------+ + | ``-arr.ndim`` | 0 | + +-------------------+----------------------+ + | |vdots| | |vdots| | + +-------------------+----------------------+ + | ``-1`` | ``arr.ndim-1`` | + +-------------------+----------------------+ + | ``0`` | ``0`` | + +-------------------+----------------------+ + | |vdots| | |vdots| | + +-------------------+----------------------+ + | ``arr.ndim`` | ``arr.ndim`` | + +-------------------+----------------------+ + | ``arr.ndim + 1`` | raise ``AxisError`` | + +-------------------+----------------------+ + + .. |vdots| unicode:: U+22EE .. Vertical Ellipsis Returns ------- |