Koordinaten von Punkt auf numpy array

Habe ich ein numpy-array:

[[  0.   1.   2.   3.   4.]
 [  7.   8.   9.  10.   4.]
 [ 14.  15.  16.  17.   4.]
 [  1.  20.  21.  22.  23.]
 [ 27.  28.   1.  20.  29.]]

was ich möchte schnell finden, die Koordinaten von bestimmten Werten und vermeiden python-Schleifen auf dem array. Zum Beispiel, die Zahl 4 auf:

row 0 and col 4
row 1 and col 4
row 2 and col 4

sowie eine Suche-Funktion zurückgeben soll ein Tupel:

((0,4),(1,4),(2,4))

Kann dies direkt über nunmpy Funktionen?

InformationsquelleAutor | 2011-03-30

Schreibe einen Kommentar