[Numpy-discussion] list to array is slow

marco cammarata marcocamma@gmail....
Thu Jul 22 16:09:47 CDT 2010


Hi,

any idea why the simple code below is so slow ?

import numpy as n
from time import time as t

dims = (640,480)
m = n.random.random( dims )

l=[]

for i in range(200):
        l.append(m)

t0=t()
b=n.array(l)
print t()-t0


To convert the list into an array takes about 5 sec ...

Thanks,
marco



More information about the NumPy-Discussion mailing list