I am using python and running my example on google colab. I am new to csv writing. I want to csv write out like the following. desired output example The issue I am having is with my lists in 'add' and 'reg'. When I run my example code I get the following. my output What should I do to get my desired output? Below is my attempt. If there is another post that has a similar situation as mine could you link it as I have already tried searching and could not find someone with the the issue as mine.
d = [{'local_date': '12/16/2022', 'local_time': '12:00', 'add':[2, 8, 22, 17], 'reg':[1001, 1002, 1003, 1004] }]
fields = ['local_date', 'local_time', 'add', 'reg']
with open("tester.csv", "w") as outfile:
writer = csv.DictWriter(outfile, fieldnames = fields)
writer.writeheader()
writer.writerows(d)