I have dictionay list which looks like this:
{'match':['football','cricket','baseball'],'player':['2','11','8']}
I want to convert this dictionary into csv but without using pandas.
My code:
import csv
my_dictionary = {'match':['football','cricket','baseball'],'player'['2','11','8']}
with open('data.csv', 'w') as f:
for key in my_dictionary.keys():
f.write("%s, %s\n" % (key, my_dictionary[key]))
The output I would like to see:
match player
football 2
cricket 11
baseball 8