count positive values in numpy code example Example: how to count positive elements numpy >>> np.sum(np.array(x) > 0, axis=0) array([3, 3, 3, 3, 3, 0])