[Numpy-discussion] numarray.fromfunction and Float32

Sebastian Haase haase at msg.ucsf.edu
Fri Mar 7 12:16:27 EST 2003

I am just looking into numarray.fromfuntion.
I have e.g. this:

def  func(x,y,z):
    return 1.2*(x+y+z)

a = na.fromfunction(func, (nz,ny,nx))
b = a.astype(na.Float32)

Is there a way to tell fromfunction to _directly_ generate a Float32 typed
As I see it only "standard" Python type are possible now.
Or: Is there a scalar conversion function like numarray.Float32( 3.141 ) ?

Sebastian Haase

More information about the NumPy-Discussion mailing list