Consider the following numpy array array:
x = np.array([2]*4, dtype=np.uint8)
which is just an array of four 2's.
I want to perform a bitwise_and reduction of this array:
y = np.bitwise_and.reduce(x)
I expect the result to be:
2
because each element of the array is identical, so successive AND's should yield the same result, but instead I get:
0
Why the discrepancy?