nums.numpy.zeros#

nums.numpy.zeros(shape, dtype=<class 'float'>)#

Return a new array of given shape and type, without initializing entries.

This docstring was copied from numpy.zeros.

Some inconsistencies with the NumS version may exist.

Return a new array of given shape and type, filled with zeros.

shapeint or tuple of ints

Shape of the new array, e.g., (2, 3) or 2.

dtypedata-type, optional

The desired data-type for the array, e.g., int. Default is float.

outBlockArray

Array of zeros with the given shape and dtype.

zeros_like : Return an array of zeros with shape and type of input. empty : Return a new uninitialized array. ones : Return a new array setting values to one. full : Return a new array of given shape filled with value.

The doctests shown below are copied from NumPy. They won’t show the correct result until you operate get().

>>> nps.zeros(5).get()  
array([ 0.,  0.,  0.,  0.,  0.])
>>> nps.zeros((5,), dtype=int).get()  
array([0, 0, 0, 0, 0])
>>> nps.zeros((2, 1)).get()  
array([[ 0.],
       [ 0.]])
>>> s = (2,2)  
>>> nps.zeros(s).get()  
array([[ 0.,  0.],
       [ 0.,  0.]])