Suppose you have a numpy array and a list:
>>> a = np.array([1,2,2,1]).reshape(2,2) >>> a array([[1, 2], [2, 1]]) >>> b = [
I was unable to set the flags, or use a mask to modify the value. In the end I just made a copy of the array.
a2 = np.copy(a)