numpy.ndarray.T in Python
The numpy.ndarray.T attribute makes a Transpose of an array having a dimension greater than or equal to 2.
Syntax
ndarray.T()
Parameter
NA
Return
This attribute returns the transpose of an array
Example 1
# Python Program explaining
# numpy.ndarray.T() function
import numpy as np
# creating an array
ndarray = np.array([[11, 12, 43], [24, 15, 56]])
# applying ndarray.T() fucntion
val = ndarray.T
print(val)
Output
[[11 24]
[12 15]
[43 56]]