My question is an extension of that one: Immutable numpy array?
This code prints False, because even though a
is immutable, b
is not.
a = np.arange(10)
a.setflags(write=False)
b = a[1:]
b[1] = -1
print a == np.arange(10)
Which defeats the purpose of having readonly arrays in the first place. Is there a way to inherit readonlibility in numpy?