[Numpy-discussion] numpy speed question

Ernest Adrogué eadrogue at gmx.net
Thu Nov 25 05:51:07 EST 2010


Hi,

25/11/10 @ 11:13 (+0100), thus spake Jean-Luc Menut:
> I suppose that some of the difference may come from  the default data 
> type of 64bits in numpy and 32 bits in IDL. Is there a way to change the 
> numpy default data type (without recompiling) ?

This is probably not the issue.

> And I'm not an expert at all, maybe there is a better explanation, like 
> a better use of the several CPU core by IDL ?

I'm not an expert either, but the basic idea you have to get is
that "for" loops in Python are slow. Numpy is not going to change
this. Instead, Numpy allows you to work with "vectors" and "arrays"
so that you need not putting loops in your code. So, you have to
change the way you think about things, it takes a little to get
used to it at first.

Cheers,

-- 
Ernest



More information about the NumPy-Discussion mailing list