Dear list,

is nonzero the appropriate function to get the indexes of a boolean array?

foo = numpy.random.random(10000)
cut = foo > .5
indexes = cut.nonzero()[0]

Another question: Why is the the type returned by nonzero a tuple and not an
ndarray of the same shape as the input (or self if used on an object)?

Thanks! Bernhard
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to