[Numpy-discussion] (no subject)

Skipper Seabold jsseabold@gmail....
Wed Mar 2 16:28:30 CST 2011


On Wed, Mar 2, 2011 at 5:25 PM, Alex Ter-Sarkissov <ater1980@gmail.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.
>

In [1]: import numpy as np

In [2]: A = np.random.randn(10,10)

In [3]: np.where(A==np.min(A))
Out[3]: (array([5]), array([3]))

Skipper


More information about the NumPy-Discussion mailing list