[Numpy-discussion] adding booleans

josef.pktd@gmai... josef.pktd@gmai...
Fri Jun 7 15:58:01 CDT 2013

Interesting observation, (while lurking on a pull request)

>>> np.add.reduce(np.arange(5)<3)
>>> np.add((np.arange(5)<3), (np.arange(5)<3))
array([ True,  True,  True, False, False], dtype=bool)

I often use summing of an array of boolean but didn't know the second behavior


More information about the NumPy-Discussion mailing list