[Numpy-discussion] numpy ndarray questions

Sturla Molden sturla@molden...
Tue Jan 27 05:04:46 CST 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