chaospy.transpose

chaospy.transpose(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], axes: Union[None, Sequence[int], numpy.ndarray] = None) numpoly.baseclass.ndpoly[source]

Permute the dimensions of an array.

Args:
a:

Input array.

axes:

By default, reverse the dimensions, otherwise permute the axes according to the values given.

Return:

a with its axes permuted. A view is returned whenever possible.

Example:
>>> poly = numpoly.monomial([3, 3]).reshape(2, 3)
>>> poly
polynomial([[1, q0, q0**2],
            [q1, q0*q1, q1**2]])
>>> numpoly.transpose(poly)
polynomial([[1, q1],
            [q0, q0*q1],
            [q0**2, q1**2]])