[Numpy-discussion] sum and prod

Han Genuit hangenuit at gmail.com
Sat Sep 8 18:06:32 EDT 2012


Hi,

Maybe try something like this?

>>> args = np.array([4,8])
>>> np.prod(args > 0)
1
>>> np.sum(args > 0)
2

Cheers,
Han



More information about the NumPy-Discussion mailing list