Numpy:
a = np.random.random_integers(low = -100, high = 100, size = (100,))
a[np.logical_and(a % 2 == 0, a > 0)
(or a[(a % 2 == 0) * (a > 0)])Logical indexing is used everywhere in numerical computing. Using functions like logical_and() or boolean multiplication or addition is more difficult to follow than Matlab or Julia.
Julia:
a = rand(-100:100, 100)
a[(a % 2 .== 0) & (a .> 0)]
Well, that's beautiful. Element-wise operations are prefixed with "."