标签: python numpy
>>> a = [1,2,3] >>> b = np.array(a, copy=False) >>> b array([1, 2, 3]) >>> a[0] = 0 >>> b array([1, 2, 3]) >>> a [0, 2, 3] >>> b array([1, 2, 3])
根据参数名称“ copy”来判断,当“ copy = False”时,我期望a和b共享内存。