numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParameters
copy(self, *args, **params) a.copy(order='C')

Notes

This function is the preferred method for creating an array copy. The function numpy.copy is similar, but it defaults to using order 'K', and will not pass sub-classes through by default.

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 :None:None:`a` is Fortran contiguous, 'C' otherwise. 'K' means match the layout of :None:None:`a` as closely as possible. (Note that this function and numpy.copy are very similar but have different default values for their order= arguments, and this function always passes sub-classes through.)

Return a copy of the array.

See Also

numpy.copy

Similar function with different default behavior

numpy.copyto

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
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/core.py#None
type: <class 'numpy.ma.core._frommethod'>
Commit: