[Numpy-discussion] extremely slow array indexing?

Robert Kern robert.kern at gmail.com
Thu Nov 30 12:15:25 CST 2006

Fang Fang wrote:
> Thanks for your reply. The simplified code is as follows. It takes 7
> seconds to process 1000 rows, which is tolerable, but I wonder why it
> takes so long. Isn't vectorized operation supposed to run very quickly.

One problem is that you are creating a new currSum array for every row. Try using

  currSum += row

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list