Difference between simple assignment , view and deep copy
simple assignment
1 | a = np.array([[1,2],[3,4]]) |

change shape
1 | b.shape = (4,1) |

change value
1 | b[3,0] = 999 |

view.() : shadow copy
1 | a = np.array([[1,2],[3,4]]) |

change shape
notice that changing the shape of c doesn’t change the shape of b
1 | c.shape = (4,1) |

change value
1 | c[3,0] = 999 |

.copy() : deep copy
1 | a = np.array([[1,2],[3,4]]) |

change shape
notice that changing the shape of c doesn’t change the shape of d
1 | d.shape = (4,1) |

change value
notice that changing the shape of c doesn’t change the value of d
1 | d[3,0] = 999 |

Conclusion
| simple assignment | .view() | .copy() | |
|---|---|---|---|
| Change shape of it affects the original item | O | X | X |
| Change value of it affects the original item | O | O | X |
ref NumPy 1.14 教學 – #06 簡易指定(Simple Assignments), 檢視(Views), 深度拷貝(Deep Copy)