I found out a curious thing today and was wondering if somebody could shed some light into what the difference is here?
import numpy as np A = np.arange(12).reshape(4,3) for a in A: a = a + 1 B = np.arange(12).reshape(4,3) for b in B: b += 1
After running each
A has not changed, but
B has had one added to each element. I actually use the
B version to write to a initialized NumPy array within a