Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.ndarray.copy

ndarray.copy(order='C')

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’ ifa is Fortran contiguous,‘C’ otherwise. ‘K’ means match the layout ofa as closelyas possible. (Note that this function andnumpy.copy are verysimilar, 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)
>>>xarray([[0, 0, 0],       [0, 0, 0]])
>>>yarray([[1, 2, 3],       [4, 5, 6]])
>>>y.flags['C_CONTIGUOUS']True

Previous topic

numpy.ndarray.conjugate

Next topic

numpy.ndarray.cumprod

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp