chaospy.moveaxis¶
- chaospy.moveaxis(a: Union[numpy._typing._array_like._SupportsArray[numpy.dtype], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]], numpoly.baseclass.ndpoly], source: Union[int, Sequence[int]], destination: Union[int, Sequence[int]]) numpoly.baseclass.ndpoly [source]¶
Move axes of an array to new positions.
Other axes remain in their original order.
- Args:
- a:
The array whose axes should be reordered.
- source:
Original positions of the axes to move. These must be unique.
- destination:
Destination positions for each of the original axes. These must also be unique.
- Return:
Array with moved axes. This array is a view of the input array.
- Example:
>>> poly = numpoly.monomial(6).reshape(1, 2, 3) >>> numpoly.moveaxis(poly, 0, -1).shape (2, 3, 1) >>> numpoly.moveaxis(poly, [0, 2], [2, 0]).shape (3, 2, 1)