Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

CSV.DictReader

01
02
03
04
05
06
07
08
09
10
# importing DictReader class  from csv module
from csv import DictReader
 
# opening csv file named as airtravel.csv
with open('airtravel.csv','r') as file:
    reader = DictReader(file)
    print("Data:")
    # printing each row of table as dictionary 
    for row in reader:
        print(row)
Source by www.pythonpool.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+7 =