[Numpy-discussion] (no subject)
Wed Mar 2 16:29:27 CST 2011
On Wed, Mar 2, 2011 at 16:25, Alex Ter-Sarkissov <email@example.com> wrote:
> hi, the question is probably very silly, but can't get my head around it
> Say I have an NxM numerical array. What I want is to obtain the row and
> column number of the smallest value(kinda like find command in Matlab). I
> use something like where(min(array_name)), but keep getting the error
> message. I'd be glad if any1 could have any suggestions in this regard.
|15> A = np.random.random([3,5])
|16> i = A.min(axis=1).argmin()
|17> j = A.min(axis=0).argmin()
"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