Your expression works if you add parentheses:
>>> y[(1 < x) & (x < 5)]
array(['o', 'o', 'a'],
dtype="|S1")
More Related Contents:
- difference between arrays in numpy
- Converting between datetime, Timestamp and datetime64
- How to print the full NumPy array, without truncation?
- Convert Python sequence to NumPy array, filling missing values
- numpy matrix vector multiplication [duplicate]
- Python out of memory on large CSV file (numpy)
- Get the position of the largest value in a multi-dimensional NumPy array
- Comparing numpy arrays containing NaN
- Getting data from ctypes array into numpy
- Populate a Pandas SparseDataFrame from a SciPy Sparse Matrix
- Extract upper or lower triangular part of a numpy matrix
- Sum array by number in numpy
- How to plot data from multiple two column text files with legends in Matplotlib?
- Creating cx_Freeze exe with Numpy for Python
- np arrays being immutable – “assignment destination is read-only”
- How to make a checkerboard in numpy?
- why isn’t numpy.mean multithreaded?
- Can numpy bincount work with 2D arrays?
- Binning a column with pandas
- TypeError: only length-1 arrays can be converted to Python scalars while plot showing
- How to update matplotlib’s imshow() window interactively?
- Sort invariant for numpy.argsort with multiple dimensions
- Concatenate range arrays given start, stop numbers in a vectorized way – NumPy
- Numpy – Replace a number with NaN
- Installing numpy on Docker Alpine
- How to center labels in histogram plot
- How does the axis parameter from NumPy work?
- Shift rows of a numpy array independently
- Formatting floats in a numpy array [duplicate]
- Add density curve on the histogram