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 : Python3 # Python program explaining # numpy.matlib.zeros() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib gfg = geek.matlib.zeros((3, 3)) print (gfg) Output : [[ 0. 0. 0.] [ 0. 0. 0.] [ 0. 0. 0.]] Code #2 : Python3 # Python program explaining # numpy.matlib.zeros() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib gfg = geek.matlib.zeros(4) print (gfg) Output : [[ 0. 0. 0. 0.]] Comment More infoAdvertise with us Next Article numpy.matlib.zeros() function | Python S sanjoy_62 Follow Improve Article Tags : Python Python-numpy Python numpy-arrayManipulation Python numpy-matlib Practice Tags : python Similar Reads numpy matrix operations | zeros() function numpy.matlib.zeros() is another function for doing matrix operations in numpy. It returns a matrix of given shape and type, filled with zeros. Syntax : numpy.matlib.zeros(shape, dtype=None, order='C') Parameters : shape : [int, int] Number of rows and columns in the output matrix.If shape has length 2 min read numpy.matlib.empty() function | Python numpy.matlib.empty() function return a new matrix of given shape and type, without initializing entries. Syntax : numpy.matlib.empty(shape, dtype = None, order = 'C') Parameters : shape : [int or tuple of int] Shape of the empty matrix. dtype : [data-type, optional] Desired output data-type. order : 1 min read numpy.ma.mask_rows() function | Python In this numpy.ma.mask_rows() function, mask rows of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 0. Syntax : numpy.ma.mask_rows(arr, axis = None) Parameters : arr : [array_like, MaskedArray] The array to mask. The result is a MaskedArray. axis 2 min read numpy.roots() function - Python numpy.roots() function return the roots of a polynomial with coefficients given in p. The values in the rank-1 array p are coefficients of a polynomial. If the length of p is n+1 then the polynomial is described by: p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n] Syntax : numpy.roots(p) Parame 1 min read numpy.zeros_like() in Python This numpy method returns an array of given shape and type as given array, with zeros. Syntax: numpy.zeros_like(array, dtype = None, order = 'K', subok = True) Parameters : array : array_like input subok : [optional, boolean]If true, then newly created array will be sub-class of array; otherwise, a 2 min read Like