Question: Answer in Python [10 pts] Read the ratings file to return a user-to-movies dictionary that maps user ID to the associated movies and the corresponding

Answer in Python

[10 pts] Read the ratings file to return a user-to-movies dictionary that maps user ID to the associated movies and the corresponding ratings. Write a function named read_user_ratings for this, with the ratings file as the parameter. For example: { u1: [ (m1, r1), (m2, r2) ], u2: [ (m3, r3), (m8, r8) ] } where ui is user ID, mi is movie, ri is corresponding rating.

Here is a snipit of the ratings file

Toy Story (1995)|4.0|1 Toy Story (1995)|4.0|5 Toy Story (1995)|4.5|7 Toy Story (1995)|2.5|15 Toy Story (1995)|4.5|17 Toy Story (1995)|3.5|18

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!