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