[Numpy-discussion] bug or feature?

Pierre GM pgmdevlist at gmail.com
Thu Feb 8 16:42:34 EST 2007


On Thursday 08 February 2007 16:21:09 humufr at yahoo.fr wrote:

>
> I'm very surprised by the line noted. I always thinking that the input
> variable didn't change the variable itself outside the function. 

Except that in this particular case, you explicitly change the input array 
itself by using an inplace operator.

> I can't keep the input variable if I'm not doing a copy before to call a
> function...

what about just using var1 = var1*3 ? That way, the initial array is left 
intact, and var1 inside your function is multiplied by 3.



More information about the NumPy-Discussion mailing list