我了解基本的 Python 参考资料,例如 a+=b 和 a=a+b 之间的区别,但这让我感到困惑。
import numpy as np
arr1 = np.arange(6).reshape(2,3)
arr2 = arr1[0]
arr2 is arr1[0] #returns False, when I expect True
arr1[0] = [7,8,9]
arr2 #[7,8,9], when I expect [0,1,2] since the 'is' returned False
这里发生了什么?