How can I select some specific elements from a numpy array?

Say I have imported numpy as np

y = np.random.uniform(0,6, 20)

I then want to select all elements (i.e. y < = 1)from y. Thanks in advance

More T. Ansah - Narh's questions See All
Similar questions and discussions