How find values in an array that meet two conditions using Python
An alternative (which I ended up using) is numpy.logical_and
:
choice = numpy.logical_and(np.greater(a, 3), np.less(a, 8))
numpy.extract(choice, a)
numpy.nonzero((a > 3) & (a < 8))
& does an element-wise boolean and.