[Numpy-discussion] general newbie question about applying an arbitrary function to all elements in a numpy array

Robert Kern robert.kern at gmail.com
Tue May 3 20:09:00 EDT 2011


On Tue, May 3, 2011 at 19:03, Benjamin Root <ben.root at ou.edu> wrote:

> I can't comment much on the questions you raise, but I can certainly suggest
> that np.where() function might be a much better choice than some of the
> if-statements.

But it won't be any better than the two fancy-indexing approaches he's used.

-- 
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