I get a big array (image with 12 Mpix) in the array format from the python standard lib. Since I want to perform operations on those arrays, I wish to convert it to a numpy array. I tried the following:
import numpy
import array
from datetime import datetime
test = array.array('d', [0]*12000000)
t = datetime.now()
numpy.array(test)
print datetime.now() - t
I get a result between one or two seconds: equivalent to a loop in python.
Is there a more efficient way of doing this conversion?