moveaxis#
- class saiunit.math.moveaxis(a, source, destination, **kwargs)#
Moves axes of a quantity or an array to new positions. Other axes remain in their original order.
- Parameters:
- Returns:
result – Array with moved axes. This array is a view of the input array.
- Return type:
Array| saiunit.Quantity
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> a = jnp.zeros((3, 4, 5)) * u.meter >>> u.math.moveaxis(a, 0, -1).shape (4, 5, 3)