[Numpy-discussion] numpy ndarray questions

Sturla Molden sturla at molden.no
Tue Jan 27 06:04:46 EST 2009


On 1/27/2009 6:03 AM, Jochen wrote:

 > BTW memmap arrays have
> the same problem
> if I create a memmap array and later do something like 
> a=a+1
> all later changes will not be written to the file. 

= is Python's rebinding operator.

a = a + 1 rebinds a to a different object.

As for ndarray's, I'd like to point out the difference between

a[:] = a + 1

and

a = a + 1



S.M.







More information about the NumPy-Discussion mailing list