numpoly.moveaxis#

numpoly.moveaxis(a: numpoly.typing.PolyLike, source: int | Sequence[int], destination: int | Sequence[int]) 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)