Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy transpose Function Example with use of tuples

# welcome to softhunt.net
# importing python module named numpy
import numpy as np

# making a 3x3 array
arr = np.array([[1, 2],
				[4, 5],
				[7, 8]])

# before transpose
print("Before transpose:
", arr, end ='

')

# after transpose
print("After transpose:
", arr.transpose(1, 0))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #transpose #Function #Example #tuples
ADD COMMENT
Topic
Name
1+6 =