[Numpy-discussion] efficient norm of a vector

lorenzo bolla lbolla@gmail....
Tue Mar 13 11:09:40 CDT 2007


Hi all,
just a quick (and easy?) question.
what is the best (fastest) way to implement the euclidean norm of a vector,
i.e. the function:

import scipy as S
def norm(x):
   """normalize a vector."""
   return S.sqrt(S.sum(S.absolute(x)**2))

?

thanks in advance,
Lorenzo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070313/83cb6701/attachment.html 


More information about the Numpy-discussion mailing list