I am having two arrays:
X = [1,2,3,4,5]
and
Y = [10,20,30,40,50]
I am trying to combine two arrays into one where items from array X correspond to row=0 and items from array Y correspond to row=1.
So the new array looks like:
combined = [[1,10],[2,20],[3,30],[4,40],[5,50]]
I have tried the following methods:
for element in combined:
for item in X:
element[0] = item
This should add all elements from X into the first-row of combined Like that:
combined = [[1, 0],[2, 0],[3, 0],[4, 0],[5, 0]]
However, it does not work like I expected as it gives me the following result:
combined = [[1, 0],[1, 0],[1, 0],[1, 0],[1, 0]]