I'm studying about how to work with csv files with Python (which I'm new to) and downloaded the following table, it has 89 entries with various oscar given to female actresses. I'm having problems wrapping my head around looping over key/values in dictionaries when I want specific sorting...in this case, sorting the actresses by their age.
I've tried a few solutions searching around here but couldn't understand or apply it to my code (which is very simple at the moment). What I know is that I have OrderedDict objects with a dictionary inside and it has a tuple for each key, value, e.g:
[OrderedDict([('Index', '1'), ('Year', '1928'), ('Age', '22'), ('Name', 'Janet Gaynor'), ('Movie', 'Seventh Heaven, Street Angel and Sunrise: A Song of Two Humans')]).
Current code just prints everything to console:
import csv
results = []
with open('oscar_age_female.csv') as File:
reader = csv.DictReader(File)
for row in reader:
results.append(row)
print(results)