Try this:
mask = (foo < 40) | (foo > 60)
Note: the __or__ method in an object overloads the bitwise or operator (|), not the Boolean or operator.
Try this:
mask = (foo < 40) | (foo > 60)
Note: the __or__ method in an object overloads the bitwise or operator (|), not the Boolean or operator.