[Numpy-discussion] sum and prod

Han Genuit hangenuit@gmail....
Sat Sep 8 17:06:32 CDT 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