Re: Why is indexing into an numpy array that slow?

2008-11-10 Thread Robert Kern
Rüdiger Werner wrote: Hello! Hi! numpy questions are best answered on the numpy mailing list. http://www.scipy.org/Mailing_Lists Out of curiosity and to learn a little bit about the numpy package i've tryed to implement a vectorised version of the 'Sieve of Zakiya'. While the code

Re: Why is indexing into an numpy array that slow?

2008-11-10 Thread bearophileHUGS
Rüdiger Werner: So i am looking for any explaination why the numpy version is that slow (i expected it to be at least as fast as the pure python version). For speed use Psyco with array.array. Psyco is available for Python 2.6 too now. Bye, bearophile --

Re: Why is indexing into an numpy array that slow?

2008-11-10 Thread Robert Kern
Robert Kern wrote: Rüdiger Werner wrote: Hello! Hi! numpy questions are best answered on the numpy mailing list. http://www.scipy.org/Mailing_Lists Out of curiosity and to learn a little bit about the numpy package i've tryed to implement a vectorised version of the 'Sieve of Zakiya'.

Why is indexing into an numpy array that slow?

2008-11-08 Thread R�diger Werner
Hello! Out of curiosity and to learn a little bit about the numpy package i've tryed to implement a vectorised version of the 'Sieve of Zakiya'. While the code itself works fine it is astounding for me that the numpy Version is almost 7 times slower than the pure python version. I tryed to