nums.numpy.copy
nums.numpy.copy#
- nums.numpy.copy(a: nums.core.array.blockarray.BlockArray, order='K', subok=False)#
Return an array copy of the given object.
This docstring was copied from numpy.copy.
Some inconsistencies with the NumS version may exist.
- aBlockArray
Input data.
- order{‘C’, ‘F’, ‘A’, ‘K’}, optional
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
BlockArray.copy()are very similar, but have different default values for their order= arguments.)- subokbool, optional
If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (defaults to False).
- arrBlockArray
Array interpretation of a.
copy : Preferred method for creating an array copy
This is equivalent to:
>>> nps.array(a, copy=True).get()
Only default args supported.
The doctests shown below are copied from NumPy. They won’t show the correct result until you operate
get().Create an array x, with a reference y and a copy z:
>>> x = nps.array([1, 2, 3]) >>> y = x >>> z = nps.copy(x)
Note that, when we modify x, y changes, but not z:
>>> x[0] = 10 >>> (x[0] == y[0]).get() array(True) >>> (x[0] == z[0]).get() False