[SciPy-user] lambda forms?

Emanuele Zattin emanuelez@gmail....
Thu Jun 28 09:23:15 CDT 2007


Hello,
i'm trying to define a function to calculate the sum of some gaussian
given their paramers. Something like:

def gaussian(height, center_x, center_y, width):
    """Returns a gaussian function with the given parameters"""
    width = float(width)
    return lambda x,y:
sum(height*exp(-(((center_x-x)/width)**2+((center_y-y)/width)**2)/2))

where all the parameters are arrays of the same length (the length is variable).
This version of course does not work, but i wonder if it is still
possible using lambda forms or if i have to write the function in an
explicit way.

Emanuele


More information about the SciPy-user mailing list