Question
[8 pts] Genre dictionary Write a function create_genre_dict that takes as a parameter the movie-to-genre dictionary (created in Task 1.2). The function should return another
[8 pts] Genre dictionary Write a function create_genre_dict that takes as a parameter the movie-to-genre dictionary (created in Task 1.2). The function should return another dictionary in which a genre is mapped to all the movies in that genre. For example: { genre1: [ m1, m2, m3], genre2: [m6, m7] }
[8 pts] Average Rating Write a function calculate_average_rating that takes as a parameter a ratings dictionary (created in Task 1.1). It should return a dictionary where the movie is mapped to its average rating computed from the ratings list. For example: {"Spider-Man (2002)": [3,2,4,5]} ==> {"Spider-Man (2002)": 3.5}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started