I have 3 lists of integers in format:
a = [1,2,3]
b = [4,5,6]
c = [7,8,9]
I am trying to enter these into a CSV file in the following format, with each item in each list taking a row and each list taking a new column:
1 4 7
2 5 8
3 6 9
Currently my code(below) is able to add the first list into the CSV, although i am having trouble adding the second and third lists in the way i wish.
with open('Test.csv', 'wb') as f:
for item in a:
csv.writer(f).writerow([item])
Gives CSV Output:
1
2
3
If i simply use the following code the b list is added to the same column, i require it to be inserted into the second column:
for itemB in b:
csv.writer(f).writerow([itemB])
Gives CSV Output:
1
2
3
4
5
6
How can i achieve this?