wBernhard Voigt <[EMAIL PROTECTED]> kirjoitti:
> is nonzero the appropriate function to get the indexes of a boolean array?
>
> foo = numpy.random.random(1)
> cut = foo > .5
> indexes = cut.nonzero()[0]
I think writing
indices = where(foo > 5)[0]
might be more clear, although it does t
Dear list,
is nonzero the appropriate function to get the indexes of a boolean array?
foo = numpy.random.random(1)
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