Answers for "Python NumPy transpose Function Example with use of tuples"

0

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:\n", arr, end ='\n\n')

# after transpose
print("After transpose:\n", arr.transpose(1, 0))
Posted by: Guest on April-21-2022

Python Answers by Framework

Browse Popular Code Answers by Language