Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add headers in csv file using python

import csv

f = open("fruits.csv", "w")
writer = csv.DictWriter(
    f, fieldnames=["fruit", "count"])
writer.writeheader()
f.close()
Outputfruits.csvfruit,count
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #add #headers #csv #file #python
ADD COMMENT
Topic
Name
5+6 =