Numpy T attribute

from numpy import *

arr = array([[10,20,30,40,50],[11,22,33,4,5]])
print(‘Original array\n’,arr)

print(‘\nTransposed array: ‘)

print(arr.T)


Output

Original array
[[10 20 30 40 50]
[11 22 33 4 5]]

Transposed array:
[[10 11]
[20 22]
[30 33]
[40 4]
[50 5]]

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.