[Numpy-discussion] getting position index from array

Ruby Stevenson ruby185 at gmail.com
Thu Jan 19 23:28:08 EST 2012


hi, all

I am a newbie on numpy ... I am trying to figure out, given an array,
how to get back position value based on some conditions.
Say, array([1, 0, 0, 0 1], and I want to get a list of indices where
it is none-zero, [ 0 , 4 ]

The closest thing I can find from the doc is select(), but I can't
figure out how to use it properly.

Thanks for your help.

Ruby



More information about the NumPy-Discussion mailing list