Return an array copy of the given object.
Controls the memory layout of the copy. ‘C’ means C-order,
‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous,
‘C’ otherwise. ‘K’ means match the layout of a as closely
as possible. (Note that this function and
ndarray.copy are very
similar, but have different default values for their order=
Array interpretation of a.
This is equivalent to:
>>> np.array(a, copy=True)
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 = 10 >>> x == y True >>> x == z False