numpy.matlib.empty() function | Python Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report 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 : [{āCā, āFā}, optional] Whether to store multi-dimensional data in row-major (C-style) or column-major (Fortran-style) order in memory. Return : [matrix] A new matrix of given shape and type, without initializing entries. Code #1 : Python3 # Python program explaining # numpy.matlib.empty() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib # filled with random data gfg = geek.matlib.empty((2, 2)) # output will be random print (gfg) Output : [[ 6.91957648e-310 1.90383493e-316] [ 6.91957669e-310 5.30409905e-317]] Code #2 : Python3 # Python program explaining # numpy.matlib.empty() function # importing numpy as geek # and importing matlib module import numpy as geek import numpy.matlib # filled with random data gfg = geek.matlib.empty((2, 2), dtype = int) # output will be random print (gfg) Output : [[139855860099992 40294208] [139855825297024 10730496]] Comment More infoAdvertise with us Next Article numpy.matlib.empty() function | Python sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy Python numpy-arrayManipulation python Python numpy-matlib +1 More Practice Tags : Machine Learningpython Similar Reads numpy.matrix.A() function - Python numpy.matrix.A() function return self as an ndarray object. Syntax : numpy.matrix.A() Parameters : None Return : [ndarray] Return self as an ndarray. Code #1 : Python3 # Python program explaining # numpy.matrix.A() function # importing numpy as geek import numpy as geek mat = geek.matrix(geek.arange 1 min read numpy matrix operations | empty() function numpy.matlib.empty() is another function for doing matrix operations in numpy.It returns 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 desired output empty matrix. 1 min read numpy.matlib.zeros() function | Python 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 floa 1 min read numpy.empty_like() in Python numpy.empty_like(a, dtype = None, order = 'K', subok = True) : Return a new array with the same shape and type as a given array. Parameters : shape : Number of rows order : C_contiguous or F_contiguous dtype : [optional, float(by Default)] Data type of returned array. subok : [bool, optional] to mak 1 min read numpy.ma.filled() function - Python numpy.ma.filled() function return input as an array with masked data replaced by a fill value. If arr is not a MaskedArray, arr itself is returned. If arr is a MaskedArray and fill_value is None, fill_value is set to arr.fill_value. Syntax : numpy.ma.filled(arr, fill_value = None) Parameters : arr : 1 min read Like