How do I select elements of an array given condition?
Suppose I have a numpy array x = [5, 2, 3, 1, 4, 5], y = ['f', 'o', 'o', 'b', 'a', 'r']. I want to select the elements in y corresponding to elements in x that are greater than 1 and less than 5.
I tried
x = array([5, 2, 3, 1, 4, 5])
y = array(['f'...