[Numpy-discussion] Vectorize ufunc
Travis Oliphant
oliphant at enthought.com
Fri Aug 7 15:35:02 EDT 2009
The short answer is that it was easier this way.
The ufunc is created on the fly and it needs to know several things
that are easy to get once the function is called.
Sent from my iPhone
On Aug 7, 2009, at 11:42 AM, T J <tjhnson at gmail.com> wrote:
> I was wondering why vectorize doesn't make the ufunc available at the
> topmost level....
>
>>>> def a(x,y): return x + y
>>>> b = vectorize(a)
>>>> b.reduce
>
> Instead, the ufunc is stored at b.ufunc.
>
> Also, b.ufunc.reduce() doesn't seem to exist until I *use* the
> vectorized function at least once. Can this be changed so that it
> exists right away (and preferably at b.reduce instead of
> b.ufunc.reduce)?
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
More information about the NumPy-Discussion
mailing list