[Numpy-discussion] adding booleans

josef.pktd at gmail.com josef.pktd at gmail.com
Sat Jun 8 07:40:49 EDT 2013


Question about namespace

why is there bool and bool_ ?

>>> np.bool(True) + np.bool(True)
2
>>> np.bool_(True) + np.bool_(True)
True

>>> type(np.bool(True))
<type 'bool'>
>>> type(np.bool_(True))
<type 'numpy.bool_'>

I didn't pay attention to the trailing underline in Pauli's original example

Josef



More information about the NumPy-Discussion mailing list