I have two boolean lists, e.g.,
x=[True,True,False,False] y=[True,False,True,False]
I want to AND these lists together, with the expected o
Instead of using
[a and b for a, b in zip(x, y)]
one could just use the possibility of numpy to multiply bool-values:
(np.array(x)*np.array(y)) >> array([ True, False, False, False], dtype=bool)
Or do I overlook a special case?