Articles → NUMPY → Arrays of zero in NumPyArrays of zero in NumPyIn this article, we will discuss zeros method in NumPy.Purpose Zeros method returns an array of specific size that are filled with zeros.Example In this example, we will create a one- and two-dimensional array. import numpy as np np.zeros(5) # Single dimensional arrayClick to Enlargeimport numpy as np np.zeros((5, 5)) # Two dimensional arrayClick to EnlargePosted By - Karan Gupta Posted On - Monday, March 18, 2019 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
import numpy as np np.zeros(5) # Single dimensional array
import numpy as np np.zeros((5, 5)) # Two dimensional array
Query/Feedback