Let's say i have 2 lists in a list:
List = [[1,2,3], [4,5,6]]
If i wanted to transpose the two lists i would go like this:
NewList = zip (List[0], List[1])
in this case if i export the lists to a csv file using this:
with open("Transposed.csv", "wb") as f:
writer = csv.writer(f)
writer.writerows(NewList)
I will get this:
1 4
2 5
3 6
Now in a case where i have a large number of lists in the main list, and i would like to avoid manually adding every single one of them into the zip function, is there a way i can do a for loop to transpose all the lists in the main list? instead of going like this:
NewList = zip (List[0], List[1]), ......List[20])