numpy.copy(a, order='K')
[source]
Return an array copy of the given object.
Parameters: |
|
---|---|
Returns: |
|
This is equivalent to:
>>> np.array(a, copy=True) #doctest: +SKIP
Create an array x, with a reference y and a copy z:
>>> x = np.array([1, 2, 3]) >>> y = x >>> z = np.copy(x)
Note that, when we modify x, y changes, but not z:
>>> x[0] = 10 >>> x[0] == y[0] True >>> x[0] == z[0] False
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.copy.html