I am trying to export the data like this
['sure', '2']: 169
['2', 'trash']: 1
['what', '2077']: 8
['us', '1']: 75
['1']: 61
['7']: 9
['7', 'years']: 9
['great']: 56
['2']: 39
['hi']: 69
['game', '5']: 1
['experience', '1010']: 1
['100%']: 10
['5']: 12
['5', 'hours']: 2
['game', '1010']: 7
['1010']: 40
['4']: 30
['90%']: 5
['exist', '7']: 1
... created by
my_list = sorted(df, reverse=True)
d = []
c = []
for i,l in enumerate(d):
if c[i] == 1:
d.pop(i)
c.pop(i)
for i,l in enumerate(d):
print(f"{d[i]}: {c[i]}")
I would like to export the excel file (or csv). Could you please tell me where I should include the to_excel (to_csv) in order to print my lists (d[i]) and their frequencies are (c[i])?