[SciPy-User] Efficiently applying a function over a large array

denis denis-bz-gg at t-online.de
Wed Feb 10 12:01:03 EST 2010


Jose,
  it sounds as though MyFunction is doing quite a lot, say 100 times
more flops
than the outer loop ? If so, speeding up the loop would gain < 1 %.
You could timeit for i: for j: dummyfunc()
but in general describe, code, test, *then* look at the whole
picture / speedup.
Bytheway arr1[i,j,:] is fast too, no copy.

cheers
  -- denis



More information about the SciPy-User mailing list