I have binary vectors X1 through X6 and Y1 through Y6. I want to find the outer product between each vector in X and its corresponding vector in Y, e.g. outer product of (X1,Y1) , outer product of (X2,Y2) and so on. I am using numpy.outer(X1, Y1). Now I want to generate a for loop to go through all of them and then OR their outputs together. Below is my code I get the error "SyntaxError: can't assign to operator" when I remove the %d beside the w on the LHS of the equation I get another error that X isn't defined. So, can anybody help me on how to solve this issue.
X1=[1, 0, 0, 1, 0]
X2=[0, 0, 0, 1, 1]
X3=[1, 0, 1, 0, 0]
X4=[1, 0, 0, 0, 1]
X5=[1, 1, 0, 0, 0]
X6=[0, 1, 0, 1, 0]
Y1=[[1], [0], [0], [0], [0]]
Y2=[[0], [0], [1], [0], [0]]
Y3=[[0], [1], [0], [0], [0]]
Y4=[[0], [0], [0], [1], [0]]
Y5=[[0], [0], [0], [0], [1]]
Y6=[[0], [0], [0], [1], [0]]
w=(5,5)
wt= np.zeros((w),dtype=np.integer)
for i in range (1, 6):
w%d=np.outer(X%d,Y%d) % (i, i, i)
wt=wt or w%d % i
print wt
Thanks
w%d=np.outer(X%d,Y%d) % (i, i, i)to do exactly?