Matthew Brett skrev:
> and - does this in fact optimize the array creation time (as opposed
> to subsequent array indexing)?  I'm creating thousands of arrays of
> various dtypes known only at run time,
>   
No, but I doubt using the C API will be much faster.

There are things you can do to speed this up, for example storing 
arguments and np.ndarray in local variables:

cdef object _kwargs = {'shape':  (n,),  dtype=dt,  buffer=data}
cdef object _ndarray = np.ndarray

arr = _ndarray(**_kwargs)


Sturla


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to