Python numpy's attention points copy and view

1. a = b does not copy at all, a and b affect each other

2. The operation of a = b[:] view, a kind of slicing, will create a new object a, but the data of a is completely kept by b, and the data changes of the two are consistent

3. a = b.copy() copy, a and b do not affect each other

Guess you like

Origin blog.csdn.net/Ghjkku/article/details/131363970