Previous topic

trapz

Next topic

mipylib.numeric.random

This Page

zeros

mipylib.numeric.minum.zeros(shape, dtype='float')

Create a new aray of given shape and type, filled with zeros.

Parameters:
  • shape – (int or sequence of ints) Shape of the new array, e.g., (2, 3) or 2.
  • dtype – (data-type, optional) The desired data-type for the array, including ‘int’, ‘float’ and ‘double’.
Returns:

(MIArray) Array of zeros with the given shape and dtype.

Examples

>>> zeros(5)
array([0.0, 0.0, 0.0, 0.0, 0.0])
>>> zeros(5, dtype='int')
array([0, 0, 0, 0, 0])
>>> zeros((2, 1))
array([[0.0]
      [0.0]])