Answers for "how to create a numpy array of 9 zeros"

1

create zero array in python

# WE CAN USE NUMPY FOR THIS 
import numpy as np
np.zeros(5) # Creates an array [0., 0., 0., 0., 0.]

# For integer array of zeros

np.zeros((5,), dtype=int) # Creates array [0, 0, 0, 0, 0]
Posted by: Guest on October-19-2021
10

declare numpy zeros matrix python

import numpy as np
dimensions = (3, 3)
np.zeros(dimensions) # 3x3 zeros matrix
Posted by: Guest on August-30-2020

Code answers related to "how to create a numpy array of 9 zeros"

Python Answers by Framework

Browse Popular Code Answers by Language