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 mean data is shared between both arrays? > > but if i do > destarray=array(srcarray) > or > destarray=srcarray.copy() > then the change in one array will not affect the other,meaning no data > sharing > ...want to know if my understanding is right > jim
You're right, I wrote too quickly and so I gave a wront information! sorry! :-) Just try the following: Apart from the copy method (which other have correctly pointed to), the correct version is simply: a = numpy.array([1,2]) b = numpy.array(a) and now try modifying one of them. bye Francesco -- http://mail.python.org/mailman/listinfo/python-list