[Numpy-discussion] memory allocation at assignment

astronomer shailendra.vikas at gmail.com
Wed Jun 27 19:38:02 EDT 2012


Hi All,
I am wondering if there any difference in memory overhead between the
following code.
a=numpy.arange(10)
b=numpy.arange(10)
c=a+b

and 
a=numpy.arange(10)
b=numpy.arange(10)
c=numpy.empty_likes(a)
c[:]=a+b

Does the later code make a temproray array for the result of (a+b) and then
copy it to c. I beleive it does that, but i wanted to make sure.

Thanks,

-- 
View this message in context: http://old.nabble.com/memory-allocation-at-assignment-tp34083731p34083731.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.




More information about the NumPy-Discussion mailing list