This routine, specialized for object arrays, might be implemented more efficiently in C.
post = np.empty(array.shape, dtype=DTYPE_BOOL)
for coord, v in np.ndenumerate(array):
post[coord] = not bool(array[coord])
return post | np.not_equal(array, array)
This routine, specialized for object arrays, might be implemented more efficiently in C.