Open In App

numpy.matlib.zeros() function | Python

Last Updated : 22 Apr, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
numpy.matlib.zeros() function return matrix of given shape and type, filled with zeros.
Syntax : numpy.matlib.zeros(shape, dtype = None, order = 'C') Parameters : shape : [sequence of ints] Shape of the empty matrix. dtype : [data-type, optional] The desired data-type for the matrix, default is float. order : [{‘C’, ‘F’}, optional] Whether to store the result in C- or Fortran-contiguous order, default is ‘C’. Return : [matrix] Zero matrix of given shape, dtype, and order.
Code #1 :
Output :
[[ 0.  0.  0.]
 [ 0.  0.  0.]
 [ 0.  0.  0.]]
  Code #2 :
Output :
[[ 0.  0.  0.  0.]]

Next Article

Similar Reads