So I'm trying to create an array of the same size as [A]. What I want is a for-loop that checks if the 1st value of the ith element in the Array == 0, However it keeps telling me that there is more than one element in the truth value of an array when there shouldn't be as I indexed the 1st value of the ith element in my array. Here is my code:
n = 4
N = [i for i in range(1,n+1)]
V = [0] + N
K = N + [5]
M = [0,1]
A = np.array([(i,j,k) for i in V for j in K for k in M if i!=j])
C=[]
for i in A:
if A[i][0]==0:
C.append([0.7])
elif abs(A[i][0]-A[i][1])<=1:
C.append([1])
else:
C.append([0])