numpy.copyto
-
numpy.copyto(dst, src, casting='same_kind', where=True)
-
Copies values from one array to another, broadcasting as necessary.
Raises a TypeError if the
casting
rule is violated, and ifwhere
is provided, it selects which elements to copy.New in version 1.7.0.
- Parameters
-
-
dstndarray
-
The array into which values are copied.
-
srcarray_like
-
The array from which values are copied.
-
casting{‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional
-
Controls what kind of data casting may occur when copying.
- ‘no’ means the data types should not be cast at all.
- ‘equiv’ means only byte-order changes are allowed.
- ‘safe’ means only casts which can preserve values are allowed.
- ‘same_kind’ means only safe casts or casts within a kind, like float64 to float32, are allowed.
- ‘unsafe’ means any data conversions may be done.
-
wherearray_like of bool, optional
-
A boolean array which is broadcasted to match the dimensions of
dst
, and selects elements to copy fromsrc
todst
wherever it contains the value True.
-
© 2005–2020 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.19/reference/generated/numpy.copyto.html