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 254 views
1 answer 163 views
1 answer 152 views
1 answer 193 views
...