NumPy Array Comparison Error: Fix Needed

When using NumPy arrays

Let x be a NumPy array. The following:

(x > 1) and (x < 3) Gives the error message:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

How do I fix this?