How to create matrix with only 0 using numpy in Python

1 Answer

0 votes
import numpy as np

matrix = np.zeros((4, 4), int) 
print(matrix)



'''
run:

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

'''

 



answered Nov 17, 2022 by avibootz

Related questions

...