numpy copy & deep copy
import numpy as np# copy & deep copy
a = np.arange(4)
print(a)
b = a
c = a
d = b
# 改变a 的值
print('******************')
a = 11
print(a)
print(b)
print(b is a)
print('******************')
print(c)
print(c is a)
print('******************')
d =
print(d)
print(a)
print(d is a)
print('******************')
# deep copy
b = a.copy()
print(b)
a = 44
print(a)
print(b)
print('******************')
结果:
True
True
True
---------------------
页:
[1]