[Numpy-discussion] finding index in an array...
fredmfp at gmail.com
Sat Jun 13 04:38:39 EDT 2009
josef.pktd at gmail.com a écrit :
> something like this should work to find rows with specific elements,
> if I understand you correctly.
You did ;-)
> np.nonzero(A.view([('',float)]*3) == np.array((1,2,3),[('',float)]*3))
> It creates an extra dimension, that needs to be removed with , but
> it takes to long now, to remember how to get rid of it.
Ok, I get it.
BTW, I was thinking this was a FAQ and there was a more straightforward
answer, or a buitlin function to do the trick...
More information about the NumPy-Discussion