There must a be a (very) quick and efficient way to get only elements from a numpy array, or even more interestingly from a slice of it. Suppose I have a numpy array:
How about:
In [19]: b = a[s] In [20]: b[b > 0] Out[20]: array([2, 3, 4])