What could be the best way to use a list set and create or export this data to a csv file?
To begin with, I must highlight that my data is of type string so I will need a method to collect these and filter the commas and values as integer type.
signals = ['-108', '-107', '-107', '-107', '-107', '-107', '-94', '-87', '-108']
Costs = ['8325', '5175', '2698', '1754', '4767', '3652', '2417', '7527', '3698']
What I would like:
I'm getting the file like this:

The part of my code that write to the csv file:
import csv
fieldnames = ['Signals','Costs']
s = ' '.join(signals)
c = ' '.join(costs)
with open('Data_to_Csv.csv', 'w') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'Signals':s,'Costs':c})

