Hi,

> def d4():
>     d = zeros([4, 1000], dtype=float)
>     for i in range(4):
>         xy = A[i] - B
>         d[i] = sqrt( sum(xy**2, axis=1) )
>     return d
> 
> Maybe there's another alternative to d4?
> Thanks again,

I think this is the fastest you can get. Maybe it would be nicer to use
the .sum() method instead of sum function, but that is just my personal
opinion.

I am curious how this compares to the matlab version. :)

Johannes


_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to