I'm new. I would like to create few arrays from two arrays. Input arrays have the same number of rows and columns:
a = [1, 2, 3]
b = [4, 5, 6]
I would like to get:
test1 = [1, 4]
test2 = [2, 5]
test3 = [3, 6]
I tried to write some code as below:
test = []
a = [1, 2, 3]
b = [4, 5, 6]
for i in range(len(a)):
test[i] = [a[i], b[i]]
But it doesn't work. How can I get the desired output? I see that you don't understand me. I try to correct: - In reality I have much more variable than three that why I can't write:
test1, test2, test3 = zip(a,b)
- I really need this in format:
test1=[1,4]
.
.
.
testi=[ , ]
- I need separate arrays because I would like to use this for doing chart.
- Some of you think that I don't need separate arrays, ok, but how can I create chart with 67 curves?:
chart is XY axis, for example: data X = [1,10], data for Y:
Y1 = test1 = [1,4]
.
.
Y67 = test67 = [70,90]
so how I get data for Y axis for 67 curves if i have list of lists?