[Numpy-discussion] efficient way to do this?

Robert Kern robert.kern@gmail....
Mon Sep 22 10:23:06 CDT 2008

On Mon, Sep 22, 2008 at 10:22, Robert Kern <robert.kern@gmail.com> wrote:

> ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark).flat).clip(0, N-1)
> marked[ind2mark] = True

Missing parenthesis:

ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark)).flat).clip(0, N-1)

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