numarray question

Jean Brouwers JBrouwersAtProphICyDotCom at no.spam.net
Mon Jul 19 00:39:53 CEST 2004



You probably meant

  xyz = lambda x,y,z: float(x*y*z)

or maybe even

xyz = lambda x,y,z: float(x)*float(y)*float(z)


/Jean Brouwers



In article <2fCKc.1152$Vw3.217821 at news20.bellglobal.com>, Colin J.
Williams <cjw at sympatico.ca> wrote:

> SunX wrote:
> > I tried to initialize a float point array by:
> > 
> > import numarray
> > xur = numarray.fromfunction(lambda x,y,z:x*y*z, (2, 2, 2))
> > 
> > but I ended up with an integer array even though x, y, and z are all floats.
> > 
> > BTW, how do you unzip NumTut in windows?  And is there a newer version?
> > 
> > Thank you
> > Howard
> You might try something like:
> 
> import numarray
> xyz= lambda x,y,z:x*y*z
> xur = numarray.fromfunction(xyz, (6, 6, 3))
> print xur
>



More information about the Python-list mailing list