I have a CSV in below format
Where i want to convert it to dictionary in the below format,
{'Feature': 'Delivery', 'Subfolders': 'Child - 1', 'Child - 2' 'Child - 3' 'Child - 4' 'Child - 5', 'Child - 6'.... till 'Child -13'}
So far I had done the following code but am getting output like this,
{'Feature': 'Delivery', 'Subfolders': 'Child - 1'}
import csv
with open('features.csv', mode='r') as infile:
reader = csv.reader(infile)
mydict = {rows[0]: rows[1] for rows in reader}
print(mydict)
Thoughts?
row[1]
to" ".join(row[1:])
.