python: Error with numpy.where python: Error with numpy.where numpy numpy

python: Error with numpy.where


You can build your condition using parenthesis and & or np.logical_and instead of and:

(segments == 1000) & (segments == 0)

or:

np.logical_and(segments == 1000, segments == 0)