On Wed, May 2, 2012 at 9:03 AM, Henry Gomersall <[email protected]> wrote: > Is this some nuance of the way numpy does things? Or am I missing some > stupid bug in my code?
Try playing with the parameters of the following code: sz = 10000 N = 10 import numpy as np x = np.arange(sz) y = x.copy() x[:-N] = x[N:] np.testing.assert_equal(x[:-N], y[N:]) For small values of sz this typically works, but as soon as numpy needs to buffer strange things happen because you are reading from memory locations that you've already written to. Stéfan _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
