I have a program that creates two very large lists of float numbers.
We can call them list_x and list_y. They look like this:
list_x = [0.555, 0.5552, 0.55553]
list_y = [0.152, 0.155, 0.160]
I want it two be stored into a csv like this:
Column 1 Column 2
0.555 0.152
0.5552 0.155
0.55553 0.160
Here is my code:
with open('data.csv','w', newline = '') as out:
csv.writer(out, delimiter=' ', quoting=csv.QUOTE_MINIMAL).writerows(zip(list_x, list_y))
However, it prints it like this instead:
Column 1
0.555 0.152
0.5552 0.155
0.55553 0.160
And no column 2.
Thanks.