count elements using where condtion in numpy code example Example: numpy count where print(np.sum(a % 2 == 1))