numpy.transpose() in Python

The numpy.transpose() permutes the dimensions of an array.

Syntax

Parameter

a : This parameter represents an input array.

axes : It is an optional parameter which by default, reverses the dimensions, otherwise permutes the axes according to the values given.

Return

This function returns the parameter ‘a’ with its axes permuted. A view is returned whenever possible.

Example 1

Output

Pin It on Pinterest

Share This