SyntaxFix
Write A Post
Hire A Developer
Questions
Your expression works if you add parentheses:
>>> y[(1 < x) & (x < 5)] array(['o', 'o', 'a'], dtype='|S1')