numpy.ones_like() in Python
The numpy.one_like() function returns an array of given shape and type as a given array, with ones. Syntax: numpy.ones_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; o