Perfect! Thank you very much :D

It's not obvious, though...I think I should read more deeply into
Python/NumPy...but for the use I'm giving to it...

Anyway, I thought the pythonic way would be faster, but after trying with a
size 80000 instead of 8...the for loop is faster!

Pythonic time ==> 0.36776400 seconds
For loop time ==> 0.31708717 seconds

:S

On Wed, Sep 9, 2009 at 12:46 PM, Citi, Luca <[email protected]> wrote:

> Hi Ruben
>
> One dimensional arrays can be thought of as rows. If you want a column, you
> need to append a dimension.
>
> >>> d = a + b[:,None]
> which is equivalent to
> >>> d = a + b[:,np.newaxis]
>
> Best,
> Luca
> _______________________________________________
> NumPy-Discussion mailing list
> [email protected]
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to