0

Code-

import pandas as pd
df=pd.read_csv('C:\\Users\abc\Downloads\data1.csv')
for c,b in d:
 print(c)
 print(b)
df.to_csv('C:\\Users\abc\Downloads\date.csv')

console output that i want to write in csv file

Austria
      Brand Market  ... Audible Viewable Measured Impressions
81         Austria  ...                                   653
133        Austria  ...                                     0
134        Austria  ...                                     1
144        Austria  ...                                     0
302        Austria  ...                                     0
...            ...  ...                                   ...
61153      Austria  ...                                     2
61248      Austria  ...                                     0
61298      Austria  ...                                    39
61798      Austria  ...                                    14
61990      Austria  ...                                     0

[723 rows x 29 columns]
Belgium
      Brand Market  ... Audible Viewable Measured Impressions
34         Belgium  ...                                     8
35         Belgium  ...                                     9
63         Belgium  ...                                     1
65         Belgium  ...                                     0
108        Belgium  ...                                    32
mozway
  • 194,879
  • 13
  • 39
  • 75
Madhav
  • 1
  • you haven't defined `d`, you should put the `to_csv` in the loop (with a variable file name) – mozway May 03 '22 at 06:56
  • By the way, your paths are not proper: all backslashes should be double: \\ , or use raw strings: r”C:\something\something\file.csv” – Stefan May 03 '22 at 06:59

0 Answers0