From: Norbert N. <Nor...@gm...> - 2006-01-20 08:30:15
|
Hi there, im missing a norm function in NumPy. Writing one by hand is simple, but doing so both general and efficient is a lot more tricky. Ideas? Norbert |
From: Travis O. <oli...@ie...> - 2006-01-20 16:41:12
|
Norbert Nemec wrote: >Hi there, > >im missing a norm function in NumPy. Writing one by hand is simple, but >doing so both general and efficient is a lot more tricky. > >Ideas? > > There's one in scipy (i'm not sure if it's the best of breed, but it's a starting point). Look in scipy.linalg.norm -Travis |
From: Norbert N. <Nor...@gm...> - 2006-01-24 21:10:03
|
Travis Oliphant wrote: > Norbert Nemec wrote: > >> Hi there, >> >> im missing a norm function in NumPy. Writing one by hand is simple, but >> doing so both general and efficient is a lot more tricky. >> >> Ideas? >> >> > There's one in scipy (i'm not sure if it's the best of breed, but it's > a starting point). > > Look in scipy.linalg.norm Is there a reason not to have it in numpy.linalg? That would be the most logical place for it, I would guess. |
From: <ag...@no...> - 2006-01-24 22:32:53
|
A curious problem (0.9.5.1993): n [12]: theta3 =numpy.zeros(66,dtype=float32) --------------------------------------------------------------------------- exceptions.NameError Traceback (most recent call last) /working/jrd/mod2/agn/OCCAM/AGN_GLOBAL/<ipython console> NameError: name 'float32' is not defined But n [14]: theta3 =numpy.zeros(66,dtype='f') In [15]: theta3 Out[15]: array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32) George Nuresr ----------------------------------------------------------------------- National Oceanography Centre, Southampton :: http://www.noc.soton.ac.uk |
From: Sasha <nd...@ma...> - 2006-01-25 00:56:51
|
You did not import float32. Your options: >>> from numpy import * >>> zeros(5, dtype=3Dfloat32) array([ 0., 0., 0., 0., 0.], dtype=3Dfloat32) or >>> import numpy >>> numpy.zeros(5, dtype=3Dnumpy.float32) array([ 0., 0., 0., 0., 0.], dtype=3Dfloat32) or >>> import numpy >>> numpy.zeros(5, dtype=3Dfloat) array([ 0., 0., 0., 0., 0.]) -- sasha On 1/24/06, ag...@no... <ag...@no...> wrote: > A curious problem (0.9.5.1993): > > n [12]: theta3 =3Dnumpy.zeros(66,dtype=3Dfloat32) > -------------------------------------------------------------------------= -- > exceptions.NameError Traceback (most rece= nt call > last) > > /working/jrd/mod2/agn/OCCAM/AGN_GLOBAL/<ipython console> > > NameError: name 'float32' is not defined > > But > n [14]: theta3 =3Dnumpy.zeros(66,dtype=3D'f') > > In [15]: theta3 > Out[15]: > array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., > 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., > 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., > 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., > 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., = 0.], > dtype=3Dfloat32) > > George Nuresr > > > ----------------------------------------------------------------------- > National Oceanography Centre, Southampton :: http://www.noc.soton.ac.uk > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Francesc A. <fa...@ca...> - 2006-01-25 08:25:53
|
A Dimecres 25 Gener 2006 01:56, Sasha va escriure: > You did not import float32. > > Your options: > >>> from numpy import * > >>> zeros(5, dtype=3Dfloat32) > > array([ 0., 0., 0., 0., 0.], dtype=3Dfloat32) > > or > > >>> import numpy > >>> numpy.zeros(5, dtype=3Dnumpy.float32) > > array([ 0., 0., 0., 0., 0.], dtype=3Dfloat32) > > or > > >>> import numpy > >>> numpy.zeros(5, dtype=3Dfloat) > > array([ 0., 0., 0., 0., 0.]) Another one: >>> import numpy >>> numpy.zeros(5, dtype=3D"float32") array([ 0., 0., 0., 0., 0.], dtype=3Dfloat32) =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |