Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Simon Palmer
Thanks very much everyone, this has been very helpful. I have been doing some timing of my own and the order of magnitude difference that numpy provides wins. I'm learning python as I go so some of my questions come from a lack of language skillls, but it is good to get to know the numpy dialect

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Alan G Isaac
SimonPalmer wrote: > what is the overhead associated with importing a new module (whichever > includes izip)? > I am wondering whether it is actually more efficient for me to put my > aesthetics aside and stick with my ugly but efficient loop If you do not want to use izip, you can still avoid

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Francesc Alted
A Monday 15 September 2008, SimonPalmer escrigué: > what is the overhead associated with importing a new module > (whichever includes izip)? > > I am wondering whether it is actually more efficient for me to put my > aesthetics aside and stick with my ugly but efficient loop If the loop is importa

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Gael Varoquaux
On Mon, Sep 15, 2008 at 07:14:04AM -0700, SimonPalmer wrote: > what is the overhead associated with importing a new module (whichever > includes izip)? Modules are cached, so the cost of importing a module, when it has already been loaded, is simply the cost of checking if it has been loaded, and

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread SimonPalmer
what is the overhead associated with importing a new module (whichever includes izip)? I am wondering whether it is actually more efficient for me to put my aesthetics aside and stick with my ugly but efficient loop On Sep 15, 2:32 pm, Francesc Alted <[EMAIL PROTECTED]> wrote: > A Monday 15 Septe

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Francesc Alted
A Monday 15 September 2008, Alan G Isaac escrigué: > On 9/15/2008 6:25 AM Francesc Alted apparently wrote: > > max_idx = min(len(A), len(B)) > > (A[:max_idx] * B[:max_idx]).sum() > > > > which does not require a copy becuase the [:max_idx] operator > > returns just a view of the arrays. > > But it

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread Alan G Isaac
On 9/15/2008 6:25 AM Francesc Alted apparently wrote: > max_idx = min(len(A), len(B)) > (A[:max_idx] * B[:max_idx]).sum() > > which does not require a copy becuase the [:max_idx] operator returns > just a view of the arrays. But it still requires creating a new array, so perhaps use of ``dot`` a

Re: [Numpy-discussion] product of arrays of different lengths

2008-09-15 Thread SimonPalmer
http://www.amazon.com/Eliade-Guide-World-Religions/dp/0060621451/ref=sr_1_1?ie=UTF8&s=books&qid=1221285193&sr=8-1 2008/9/13 Vasile Bouleanu <[EMAIL PROTECTED]> > Stie cineva despre existenta unei traduceri in engleza a " > Dictionarului Religiilor " cu autorii Eliade /Culianu ? > >Vasile