Grissiom, Using the following doesn't require any loop:
In [9]: sqrt((a**2.).sum(1)) Out[9]: array([ 5., 10.]) Best, On Wed, Feb 18, 2009 at 10:23 PM, Grissiom <chaos.pro...@gmail.com> wrote: > Hi all, > > Is there any possibility to calculate norm along axis? For example: > > a = np.array(( > (3,4), > (6,8))) > > And I want to get: > array([5.0, 10.0]) > > I currently use a for loop to achieve this, Is there any more elegant way > to do this? > > -- > Cheers, > Grissiom > > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion@scipy.org > http://projects.scipy.org/mailman/listinfo/numpy-discussion > > -- Nicolas Pinto Ph.D. Candidate, Brain & Computer Sciences Massachusetts Institute of Technology, USA http://web.mit.edu/pinto
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion