numpy.ma.copyΒΆ
-
numpy.ma.
copy
(self, *args, **params) a.copy(order='C') = <numpy.ma.core._frommethod object>ΒΆ - Return a copy of the array.
Parameters: - 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
numpy.copy
are very similar, but have different default values for their order= arguments.)
Examples
>>> x = np.array([[1,2,3],[4,5,6]], order='F')
>>> y = x.copy()
>>> x.fill(0)
>>> x array([[0, 0, 0], [0, 0, 0]])
>>> y array([[1, 2, 3], [4, 5, 6]])
>>> y.flags['C_CONTIGUOUS'] True