How to create an empty matrix (2D array) with NumPy in Python

1 Answer

0 votes
import numpy as np

arr = np.zeros((3, 4), dtype=int)

print(arr)



'''
run:

[[0 0 0 0]
 [0 0 0 0]
 [0 0 0 0]]

'''

 



answered Mar 11, 2023 by avibootz

Related questions

1 answer 261 views
1 answer 171 views
1 answer 160 views
1 answer 199 views
...