[Numpy-discussion] vectorized function inside a class
peridot.faceted at gmail.com
Wed Aug 8 16:53:28 EDT 2007
On 08/08/2007, mark <markbak at gmail.com> wrote:
> Thanks for the ideas to circumvent vectorization.
> But the real function I need to vectorize is quite a bit more
> So I would really like to use vectorize.
> Are there any reasons against vectorization? Is it slow?
> The way Tim suggests I expect to be slow as there are two functions
vectorize() is just shorthand for a for loop, basically; it won't win
you anything on speed over looping yourself. It does win on
convenience, but if you can write your function to act on arrays it
will run much faster.
More information about the NumPy-Discussion