numpy.empty_like() in Python Last Updated : 29 Nov, 2018 Comments Improve Suggest changes Like Article Like Report 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 make subclass of a or not Return : array with the same shape and type as a given array. Python # Python Program illustrating # numpy.empty_like method import numpy as geek a = geek.empty_like([2, 2], dtype = int) print("\nMatrix a : \n", a) c = a = ([1,2,3], [4,5,6]) print("\nMatrix c : \n", geek.empty_like(c)) Output : Matrix a : [ 16843008 1058682594] Matrix c : [[0 0 0] [0 0 0]] Note : These codes won’t run on online-ID. Please run them on your systems to explore the working. Comment More infoAdvertise with us Next Article numpy.empty_like() in Python M Mohit Gupta_OMG Improve Article Tags : Misc Python Python-numpy Python numpy-arrayCreation Practice Tags : Miscpython Similar Reads numpy.empty() in Python numpy.empty(shape, dtype = float, order = 'C') : Return a new array of given shape and type, with random values. Parameters : -> shape : Number of rows -> order : C_contiguous or F_contiguous -> dtype : [optional, float(by Default)] Data type of returned array. Python # Python Programming i 1 min read numpy.full_like() in Python The numpy.full_like() function return a new array with the same shape and type as a given array.Syntax : numpy.full_like(a, fill_value, dtype = None, order = 'K', subok = True) Parameters : shape : Number of rows order : C_contiguous or F_contiguous dtype : [optional, float(by Default )] Data type o 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.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 numpy.isnan() in Python The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax : numpy.isnan(array [, out]) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed wit 2 min read numpy.isneginf() in Python The numpy.isneginf() function tests element-wise whether it is negative infinity or not, and returns the result as a boolean array. Syntax :  numpy.isneginf(array, y = None) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boole 2 min read numpy.nonzero() in Python numpy.nonzero()function is used to Compute the indices of the elements that are non-zero. It returns a tuple of arrays, one for each dimension of arr, containing the indices of the non-zero elements in that dimension. The corresponding non-zero values in the array can be obtained with arr[nonzero(ar 2 min read Python | Numpy MaskedArray.__ne__ numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__ne__ operator we can find that which element in an array is not equal to the value which is provided in the parameter. Syntax: numpy.MaskedArray.__ne__ 1 min read numpy.logical_not() in Python numpy.logical_not(arr, out=None, where = True, casting = 'same_kind', order = 'K', dtype = None, ufunc 'logical_not') : This is a logical function that computes the truth value of NOT arr element-wise. Parameters : arr1 : [array_like]Input array. out : [ndarray, optional]Output array with same dimen 2 min read Initialize empty string in Python An empty string in Python is simply a string that has no characters in it. It is often used when we need to represent "nothing" or initialize a string variable.In this article, we will explore how to create an empty string in Python using different methods.Using Two Quotation MarksThe simplest way t 1 min read Like