Fri May 2 22:54:11 CDT 2008
On Fri, May 2, 2008 at 10:48 PM, Keith Goodman <email@example.com> wrote:
> On Fri, May 2, 2008 at 7:25 PM, Robert Kern <firstname.lastname@example.org> wrote:
> > In : def kerndist(x):
> > ...: N = x.shape
> > ...: x.flat[::N+1] = x.max()
> > ...: ij = argmin(x.flat)
> > ...: i, j = divmod(ij, N)
> > ...: return i, j
> I replaced
> ij = argmin(x.flat)
> (they're the same in this context, right?) for a slight speed up. Now
> I'm down to 1.9 seconds.
Yes, they're the same. I forgot that .argmin() flattened by default.
"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