It's simpler in numarray:
i,j = where(z<0.5)
For numeric it's more work:
ind = where(z.flat < 0.5)
i = ind//z.shape
j = ind % z.shape
One could turn this into a function for Numeric (to handle all dimensionalities, etc)
On May 17, 2005, at 10:04 AM, Dimitri D'Or wrote:
Here under a question that has probably already been asked:
I would like to apply the find() function on a bidimensional array and receive as output the bidimensional indices for the elements matching the condition. This is easy in Matlab but doesn't seem to be possible with Python.
Here is a short example (in Matlab code) of what I would like to have:
0\.9501 0\.4860 0\.4565 0\.2311 0\.8913 0\.0185 0\.6068 0\.7621 0\.8214
2 1 1 2
1 2 3 3
A solution for me?