copy a numpy array

jimgardener jimgardener at gmail.com
Wed Jan 9 06:35:35 CET 2008


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



More information about the Python-list mailing list