dask.array.moveaxis — Dask documentation (original) (raw)
Move axes of an array to new positions.
This docstring was copied from numpy.moveaxis.
Some inconsistencies with the Dask version may exist.
Other axes remain in their original order.
import numpy as np
x = np.zeros((3, 4, 5))
np.moveaxis(x, 0, -1).shape
(4, 5, 3) np.moveaxis(x, -1, 0).shape
(5, 3, 4)
np.transpose(x).shape
(5, 4, 3) np.swapaxes(x, 0, -1).shape
(5, 4, 3) np.moveaxis(x, [0, 1], [-1, -2]).shape
(5, 4, 3) np.moveaxis(x, [0, 1, 2], [-1, -2, -3]).shape
(5, 4, 3)