numpy.full_like() in Python

The full_like() method of Python numpy class returns a full array with the same shape and type as a given array.

Syntax

Parameter

shape :This parameter represents the number of rowsorder :The order parameter can be either C_contiguous or F_contiguous.dtype :It is an optional parameter. It depicts the data type of returned array, and by default, it is a float.subok :It is used to make subclass of ‘a’ or not. It is an optional parameter, and by default, it is Boolean.

Return

This method returns a new array(ndarray).

Example 1

Output

Object1 before full_like :

Object2 after full_like :

Pin It on Pinterest

Share This