Hi eat and Gary,
Thanks a lot for your suggestions, I've tried them in my code and
achieved similar speedup of ~270% for both of them. So I guess I'll
stick to one of those.
Regards,
Andrey.
> Hi,
>
> On Thu, Mar 17, 2011 at 10:44 AM, Andrey N. Sobolev
> wrote:
>
> > Dear all,
> >
> > Sorr
How about
argmin(add.reduce((a*a),axis=1))
In [5]: a
Out[5]:
array([[ 0.24202827, 0.01269182, 0.95162307],
[ 0.02979253, 0.454 , 0.49650111],
[ 0.52626565, 0.08363861, 0.56444878],
[ 0.89639659, 0.54259354, 0.29245881],
[ 0.75301013, 0.6248646 , 0.245658
Hi,
On Thu, Mar 17, 2011 at 10:44 AM, Andrey N. Sobolev wrote:
> Dear all,
>
> Sorry if that's a noob question, but anyway. I have several thousands of
> vectors stacked in 2d array. I'd like to get new array containing
> Euclidean norms of these vectors and get the vector with minimal norm.
>
>
Dear all,
Sorry if that's a noob question, but anyway. I have several thousands of
vectors stacked in 2d array. I'd like to get new array containing
Euclidean norms of these vectors and get the vector with minimal norm.
Is there more efficient way to do this than
argmin(array([sqrt(dot(x,x)) fo