I am trying to use numpy.where function as follows:
x= np.where(segments==1000 and segments == 0)
and I get a ValueError:
ValueError: The truth value of an array with more than one element is ambiguous.
Use a.any() or a.all()
Browsing through some other threads, seems this is the expected behaviour. However, I am not sure how to reformulate this using numpy.any(). I cannot get the syntax correct.