[Numpy-discussion] question about optimizing

Bryan Cole bryan at cole.uklinux.net
Sat May 17 16:09:21 EDT 2008


> 
> 
> From the response, the answer seems to be no, and that I should stick
> with the python loops for clarity.  But also, the words of Anne
> Archibald, makes me think that I have made a bad choice by inheriting
> from ndarray, although I am not sure what a convenient alternative
> would be.

It may be worth bearing in mind that indexing a python list is faster
than a ndarray (mostly because ndarrays must support many more
features), so if you don't require (or exploit) the features of ndarrays
(i.e. you don't need fancy indexing or element-wise operations), you may
be better off with lists.

BC

> 
> 
> 
> 
> 
> 
> bb
> 
> 
> 
> 
> 
> -- 
> Brian Blais
> bblais at bryant.edu
> http://web.bryant.edu/~bblais
> 
> 
> 
> 
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion





More information about the NumPy-Discussion mailing list