In this python numpy program, we will convert a tuple into a NumPy array.
Steps to solve the program
- Import the numpy library as np.
- Convert a tuple into an array using np.asarray().
- Print the output.
import numpy as np
x = np.asarray((5,7,0))
print(x)
Output :
[5 7 0]