dpnp.moveaxis

dpnp.moveaxis(x1, source, destination)[source]

Move axes of an array to new positions. Other axes remain in their original order.

For full documentation refer to numpy.moveaxis.

Limitations

Input array x1 is supported as dpnp.ndarray. Otherwise the function will be executed sequentially on CPU. Sizes of normalized input arrays are supported to be equal. Input array data types are limited by supported DPNP Data types.

See also

dpnp.transpose

Permute the dimensions of an array.

dpnp.swapaxes

Interchange two axes of an array.

Examples

>>> import dpnp 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)