Why doesn’t chained (interval) comparison work on numpy arrays?

0 < numlist < 3.5

Is equivalent to:

(0 < numlist) and (numlist < 3.5)

except that numlist is only evaluated once.

The implicit and between the two results is causing the error

Leave a Comment