Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Shane Holloway
On Mar 21, 2007, at 6:58 AM, Anne Archibald wrote: > Vectorizing apply is what you're looking for, by the sound of it: > In [13]: a = array([lambda x: x**2, lambda x: x**3]) > > In [14]: b = arange(5) > > In [15]: va = vectorize(lambda f, x: f(x)) > > In [16]: va(a[:,newaxis],b[newaxis,:]) > Out[

[Numpy-discussion] Array of Callables

2007-03-20 Thread Shane Holloway
ables]) Is it possible to have numpy call them in a way something like:: for i in xrange(vCallables.shape[0]): vResults[i] = vCallables[i] ( vParam1[i], vParam2[i], vParam3[i] ) With the core of that loop implemented in C? Thanks for reading and pondering! -Shane Hol