[Numpy-discussion] numarray.fromfunction and Float32

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


Hi,
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
array.
As I see it only "standard" Python type are possible now.
Or: Is there a scalar conversion function like numarray.Float32( 3.141 ) ?

Thanks,
Sebastian Haase






More information about the Numpy-discussion mailing list