Bug or feature: cloning a numpy array w/ slicing

前端 未结 1 364
忘掉有多难
忘掉有多难 2020-12-21 10:46

Following up to David Morrissey\'s answer on \'How to clone a list in python?\' I was running some performance tests and hit unexpected behavior when working w/ numpy arrays

相关标签:
1条回答
  • 2020-12-21 11:13

    In numpy, slices are references or "views" on the original array, so they are not copies. That is by design, not a bug. The reason is that a copy is not as useful as a view.

    0 讨论(0)
提交回复
热议问题