Python Forum

Full Version: Merge rows of 2 arrays
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have 2 arrays: time[1,2,3,4,5,] and data[0, 9, -15, 5, -2245]

I want combine these 2 arrays in such a way that I get a single array in the following format:
[1 0
2 9
3 -15
4 5
5 -2245]

Please guide
#Here you go
list1=[1,2,3,4,5]
list2=[0,9,-15,5,-2245]
list3=[]
for i in range(0,5):
list3.append(list1[i])
list3.append(list2[i])
print(list3)