numpy.rollaxis(a, axis, start=0)[source]
Roll the specified axis backwards, until it lies in a given position.
Parameters: |
a : ndarray Input array. axis : int The axis to roll backwards. 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. |
---|---|
Returns: |
res : ndarray For Numpy >= 1.10 a view of |
See also
>>> a = np.ones((3,4,5,6)) >>> np.rollaxis(a, 3, 1).shape (3, 6, 4, 5) >>> np.rollaxis(a, 2).shape (5, 3, 4, 6) >>> np.rollaxis(a, 1, 4).shape (3, 5, 6, 4)
© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.rollaxis.html