How to declare 2D array with numpy in Python

1 Answer

0 votes
import numpy as np
 
arr2d = np.array([[4, 8, 2, 5], [6, 9, 7, 3]])
 
print(arr2d)

 
 
'''
run:
 
[[4 8 2 5]
 [6 9 7 3]]

'''

 



answered Aug 9, 2022 by avibootz
...