[SciPy-user] Re: vectorize(function)/arraymap did not return arrays?
Travis Oliphant
oliphant at ee.byu.edu
Fri Jan 21 14:44:29 EST 2005
Yichun Wei wrote:
> Hi Travis,
>
> I find someone suggesting this:
>
> for x in range( (imax-1 * jmax-1)-1 ):
> i, j = x / jmax, x % jmax
> array[i,j] = ...
>
>
> However, this does not look elegant. It would be great to be able to
> loop through arrays, mapping functions returning arrays in C. I guess
> it is too difficult to have a such a general mapping function. Thank
> you anyway. Do you know of any method which can speed up the nested
> loops?
>
Well, I don't know how difficult it would be to write such a general
looping function --- I never tried to do it. It was not on my radar
when I wrote arraymap.
-Travis
More information about the SciPy-User
mailing list