I would like to return the indices of all the values in a python numpy array that are between two values. Here is my code:
inEllipseIndFar = np.argwhere(excessPathLen * 2 < ePL < excessPathLen * 3)
But it returns an error:
inEllipseIndFar = np.argwhere((excessPathLen * 2 < ePL < excessPathLen * 3).all())
ValueError: The truth value of an array with more than one element is ambiguous. Use
a.any() or a.all()
I'd like to know if there is a way of doing this without iterating through the array. Thanks!