Re: [Numpy-discussion] from_function

2009-02-10 Thread Yakov Keselman
Perhaps you can do something along the following lines to get around this limitation: # # parameterizes the original function by delta, size. def parameterized_function(delta, size, function): center = (size-1)/2.0 return lambda i: function( (i-center)*delta ) # the func

[Numpy-discussion] from_function

2009-02-03 Thread Neal Becker
I've been using something I wrote: coef_from_function (function, delta, size) which does (c++ code): double center = double(size-1)/2; for (int i = 0; i < size; ++i) coef[i] = call (func, double(i - center) * delta); I thought to translate this to np.fromfunction. It seems fromfunction