Program to convert the list into an array using NumPy.

In this python numpy program, we will convert the list into an array using NumPy.

Steps to solve the program
  1. Import the numpy library as np.
  2. Convert the list into an array using np.asarray().
  3. Print the output.
				
					import numpy as np
x = np.asarray([[3,0],[6,4]])
print(x)
				
			

Output :

				
					[[3 0]
 [6 4]]
				
			

add a vector to each row of a matrix.

convert an array into a list.

Leave a Comment