numpy.copyto() in Python

The numpy.copyto() function copies values from one array to another array.



The numpy. copyto() method consists of three parameters, which are as follows:

dst : It represents the array into which our values are copied.

src : This parameter represents the second array from which the values are copied.

casting : It is an optional parameter which controls the data casting that may occur when copying.

where : It is an optional parameter which takes a boolean array which is broadcasted to match the dimensions of dst.


This function returns a copy of the specified array.

Example 1


Example 2


Pin It on Pinterest

Share This