I would like to turn this data into a dictionary however I want the 'name' column to be the key and only the age and height as values to be associated with the name and everything else is irrelevant.
The CSV file is arranged like so name | age | color | height | weight steven | 15 | red | 70 | 150 many other names with characteristics are below this row as well
I am new to parsing csv files and can't seem to find the framework for what I am trying to do. Is there a place I can maybe put the indexes of the columns?
with open("search_rez.csv","w+", encoding="utf-8") as out:
out.write(final_data)
out.close
with open('search_rez.csv', 'r') as fh:
rd = csv.DictReader(fh, delimiter=',')
for row in rd:
print(row)
A dictionary of key's(names) and values(many characteristics) that I can access and is stored into a variable. Eventually I would like to be able to search the dictionary with a given 'name' and return the values associated with it.