C = numpy.array([a^b for a,b in A,B])
Is what I attempted. I thought it would xor each individual element in A
and B
which are matrices of their own and store it as the same shape within C
. How would you do this and where is the flaw in my logic?
EDIT: All values within A and B are ints, an example would be both being shape (3,4) containing a range of integers from 0-10
Direct xor
C = A^B
Resulted in this error:
TypeError: ufunc 'bitwise_xor' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'
The TypeError is confusing me as both A and B contain only ints. A I am 100% certain is all ints. B was constructed the following way:
B = np.vstack((A[1:],np.ones(A.shape[1])))
Should this not be all ints as well?
A
andB
? Give some examples.