[SciPy-user] retrieve indexes of 2D array element
Mon Jul 13 03:03:05 CDT 2009
I've seen this function where, but it requires three inputs and I have no clue how to use it. Is it possible to give me an example. E.g I have an array as
a = [ [1,2,3],
and I would like to retrieve the indexes of values 9 which are 2, 2.
How do I do that with scipy.where ?
--- On Mon, 7/13/09, David Warde-Farley <firstname.lastname@example.org> wrote:
From: David Warde-Farley <email@example.com>
Subject: Re: [SciPy-user] retrieve indexes of 2D array element
To: "SciPy Users List" <firstname.lastname@example.org>
Date: Monday, July 13, 2009, 7:11 AM
On 13-Jul-09, at 2:56 AM, Robert Robert wrote:
> Hi all,
> I have a 2D scipy array of integer. I can not figure out how to
> retrieve the indexes i, j of a specific element in the array. I can
> loop through the array in python and search for it, but I can not
> believe that scipy does not have a highly optimized algorithm.
By a specific element, do you mean a certain value? If so use a
boolean condition and where().
SciPy-user mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user