[Numpy-discussion] Slow conversion from list to arrays
Todd Miller
jmiller at stsci.edu
Tue Dec 30 06:36:03 EST 2003
On Thu, 2003-12-25 at 03:27, Nadav Horesh wrote:
> The conversion for a list of large arrays into a matrix is very slow in
> numarray while reasonably fast:
>
> >>> from numarray import *
> >>> a = [arange(200000), arange(200000), arange(200000), arange(200000)]
> >>> aa = array(a) # Very slow
>
> --------------------------------
>
> >>> from Numeric import *
> >>> a = [arange(200000), arange(200000), arange(200000), arange(200000)]
> >>> aa = array(a) # Fast
>
> Python version: 2.3.3
> numarray version: Official 0.8
>
> Tested under WinXP and RH9 linux.
>
> Any workaround?
>
Try concatenate. For the array sizes you're looking at, numarray does
OK. You may have to adjust the result shape.
Todd
> Nadav
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
--
Todd Miller
Space Telescope Science Institute
3700 San Martin Drive
Baltimore MD, 21030
(410) 338 - 4576
More information about the NumPy-Discussion
mailing list