On 21/03/07, Andrew Corrigan <[EMAIL PROTECTED]> wrote: > Thanks for pointing that out. Technically that works, but it doesn't really > express this operation as concisely and as naturally as I'd like to be able > to. > > What I really want is to be able to write: > > >>> a = array([lambda x: x**2, lambda x: x**3]) > >>> b = arange(5) > >>> a(b) > > and get: > array([[ 0, 1, 4, 9, 16], > [ 0, 1, 8, 27, 64]])
Well, this only makes sense for an array of callables. So you could hope for a "callable" dtype to be put into numpy, or you could write your own array class, derived from the standard one, that only holds callables and that implements a __call__ method. Anne _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion