I want a CSV designed like this:
A B C D
------ ----- ----- -----
v1 v11 v12 v13
v2 v21 v22 v23
v3 v31 v32 v33
I have a dictionary like this:
{"v1": ["v11", "v12", "v13"], "v2": ["v21", "v22", "v23"], "v3": ["v31", "v32", "v33"]}
I already tried this:
with open("cyclesAndSignalChange.csv", 'wb') as csvfile:
wr = csv.DictWriter(csvfile, cycle_with_signal_change.keys(), delimiter = ' ')
for i in cycle_with_signal_change:
wr.writeheader()
wr.writerow(cycle_with_signal_change)
But this just gives me a 1GB large file whereas my data is like 1MB.
How can I achieve this?