index = np.where(slopes > mean - 2 * sd and slopes < mean + 2 * sd)[0]
returns this error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
If I instead write idx = np.where(slopes < mean + 2 * sd)[0]
or idx = np.where(slopes > mean - 2 * sd)[0]
I get the right indices. Why can't I combine both conditions?