Python Forum

Full Version: numpy.where array search for string in just one coordinate
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the following array:
[[  258 16892 40056]
 [  259 25647 40056]
 [  260 25847 40056]
 [  261 47339 259]]
I want to search in it and find rows where just the first element == 259.
This call will find it twice in row 1 and row 3:
np.where(intArrayFromLine == 259 )
How do I compose the np.where (or other call) so that it only looks in the first column - ie so it would find just row 1 ?
thans
np.where(intArrayFromLine[:,0] == 259)
the "0" is for the 1rst column