Nov-06-2020, 10:30 AM
Hello;
Here is my code
array1([arr],[arr],[arr]….)
But the code is adding like that ([arr arr arr arr arr])
How can I solve the this problem?
Here is my code
array1 = ([])
for triplet in itertools.product([0, 1], repeat=6):
a,ap,b,bp,c,cp = triplet[0],triplet[1],triplet[2],triplet[3],triplet[4],triplet[5]
nlist = [(a,b,c),(a,b,cp),(a,bp,c),(a,bp,cp),(ap,b,c),(ap,b,cp),(ap,bp,c),(ap,bp,cp)]
#arr2 = np.array([])
arr = np.array([])
for i in range(8):
for l in range(8):
if lst[l] == nlist[i]:
arr = np.append(arr,[1])
else:
arr = np.append(arr,[0])
array1=np.append(array1,arr) #Here is the problem. When I want to add my arr array to array1, the result is like concataneta
print(arr)I want to add arr to array1 like thatarray1([arr],[arr],[arr]….)
But the code is adding like that ([arr arr arr arr arr])
How can I solve the this problem?
