Re: copy a numpy array

2008-01-09 Thread Francesco Guerrieri
On Jan 9, 2008 6:35 AM, jimgardener [EMAIL PROTECTED] wrote: thanx guys for the replies need a little clarification srcarray=array([1.2,2.3,3.4,4.5,5.6]) destarray=array(srcarray,copy=False) then srcarray[2]=99.9 will cause the change to be reflected in both src and dest. doesn't that

copy a numpy array

2008-01-08 Thread jimgardener
hi, (i posted this to numpy discussion grp couple of days back ..but it fails to appear..)since it is needed for my work i would appreciate if anyone can help me with this question i have two ndarrays of 1000 elements each and want to copy all elements from srcarray to destarray

Re: copy a numpy array

2008-01-08 Thread Francesco Guerrieri
On Jan 8, 2008 4:32 PM, jimgardener [EMAIL PROTECTED] wrote: hi, (i posted this to numpy discussion grp couple of days back ..but it fails to appear..)since it is needed for my work i would appreciate if anyone can help me with this question i have two ndarrays of 1000 elements each and

Re: copy a numpy array

2008-01-08 Thread gsal
I am new to python and everything related to it, and it so happens that I just went through the numpy tutorial last night, it is in http://www.scipy.org/Tentative_NumPy_Tutorial and the answer to your question is in section 3.7 Basically, if you want to make a (deep) copy of it: destarray =

Re: copy a numpy array

2008-01-08 Thread jimgardener
thanx guys for the replies need a little clarification srcarray=array([1.2,2.3,3.4,4.5,5.6]) destarray=array(srcarray,copy=False) then srcarray[2]=99.9 will cause the change to be reflected in both src and dest. doesn't that mean data is shared between both arrays? but if i do