Closed
Description
At least, with the void
type:
>>> v1 = np.array(b'', (np.void,1))[()]
>>> v2 = np.array(b'', (np.void,2))[()]
>>> bool(v1), bool(v2)
(False, False) # reasonable, meaning all null
>>> v1.astype(bool)
False # ok
>>> v1.astype(bool)
ValueError: setting an array element with a sequence. # uh oh
And the string type:
>>> s = np.array('0')[()]
>>> bool(s)
True
>>> s.astype(bool)
False # actually bool(int(s))