源代码
import numpy as np arr = np.array([1, 2, 3, 4, 5]) x = arr.view() x[0] = 31 print(arr) print(x)
运行结果