fork download
  1. import csv
  2. path = "sample.csv"
  3. f = open(path,"r",encoding="utf_8")
  4. path = "sample2.csv"
  5. f2 = open(path,"w",encoding="utf_8",newline='')
  6. reader = csv.reader(f)
  7. writer = csv.writer(f2)
  8. for row in reader:
  9. row = list(map(lambda x: '0' if x == '' else x,row))
  10. writer.writerow(row)
  11. f.close
  12. f2.close
  13.  
  14.  
Runtime error #stdin #stdout #stderr 0.17s 23488KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
    f = open(path,"r",encoding="utf_8")
FileNotFoundError: [Errno 2] No such file or directory: 'sample.csv'