Iterating through DictReader
DictReader()
produces a sequence of dictionaries, not just one dictionary.
for row in d:
for k, v in row.items():
You have to first iterate over the dict getting each row, and then iterate over the items in each row:
for row in d:
for k, v in row.items():
# Do stuff