copy a numpy array

jimgardener jimgardener at gmail.com
Tue Jan 8 10:32:21 EST 2008


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

srcarray=numpy.array(  [3973334.8381791776,........,382999.6748692277] )

arrsize=1000
destarray=zeros(arrsize)

i copied all items from src to dest by using
destarray[0:arrsize]=srcarray[0:arrsize]

i don't know if this is the right way to do the copying.
is there a better(efficient?) way ?
jim




More information about the Python-list mailing list