with Open
use with resource and make sure it is close, like try escape
with open(‘Input/Covid.csv’, mode=’r’) as csv_file:
DictReader(csv_file)
each row will be read as a separate dictionary creating a dictionary “set’. header will be read as dict key
open read write mode
read: r
write: w
read/write: ‘r+’
reader(csv_file)
reader splits each row on a specified delimiter and returns a list of strings; compare to Dictreader
use line count (count yourself) to split the header
writer(csv_file)
change the whole file if it is w mode
reading csv with two columns as dict
d = dict(reader)