I have created a defaultdict using a csv file. The defaultdict has a movie director as the key and a list of named tuples as the values. The named tuples have 3 elements: title, year and score. I need to isolate the year element, check whether the year is after a given year then check those results score element for each tuple is high than a given score.
Here is the output from the dictionary:
defaultdict(<class 'list'>, {'James Cameron': [Movie(title='Avatar', year=2009, score=7.9), Movie(title='Titanic', year=1997, score=7.7), Movie(title='Terminator 2: Judgment Day', year=1991, score=8.5), Movie(title='True Lies', year=1994, score=7.2), Movie(title='The Abyss', year=1989, score=7.6), Movie(title='Aliens', year=1986, score=8.4), Movie(title='The Terminator', year=1984, score=8.1)]