get_avg_ratings() takes a 2-D list similar to ratings_db as the parameter and returns a dictionary, where each {key: value} of this dictionary is {a valid movie id: the average rating this movie received by the reviewers}. I will refer to this dictionary as ratings. >>> ratings = get_avg_ratings(ratings_db) >>>> display_dict(ratings) 1: 3.92 2: 3.43 3: 3.26 4: 2.36 5: 3.07 6: 3.95 7: 3.19 8: 2.88 9: 3.12 10: 3.5 11: 3.67 12: 2.42 13: 3.12 14: 3.83 15: 3.0 16: 3.93 17: 3.78 18: 3.7 19: 2.73 20: 2.5   userId,movieId,rating,timestamp 1,1,4,964982703 5,1,4,847434962 7,1,4.5,1106635946 15,1,2.5,1510577970 17,1,4.5,1305696483 18,1,3.5,1455209816 19,1,4,965705637 21,1,3.5,1407618878 27,1,3,962685262 31,1,5,850466616 32,1,3,856736119 33,1,3,939647444 40,1,5,832058959 43,1,5,848993983 44,1,3,869251860 45,1,4,951170182 46,1,5,834787906 50,1,3,151423811

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

get_avg_ratings() takes a 2-D list similar to ratings_db as the parameter and returns a dictionary, where each {key: value} of this dictionary is {a valid movie id: the average rating this movie received by the reviewers}. I will refer to this dictionary as ratings.
>>> ratings = get_avg_ratings(ratings_db)
>>>> display_dict(ratings)
1: 3.92
2: 3.43
3: 3.26
4: 2.36
5: 3.07
6: 3.95
7: 3.19
8: 2.88
9: 3.12
10: 3.5
11: 3.67
12: 2.42
13: 3.12
14: 3.83

15: 3.0
16: 3.93
17: 3.78
18: 3.7
19: 2.73
20: 2.5

 

userId,movieId,rating,timestamp
1,1,4,964982703
5,1,4,847434962
7,1,4.5,1106635946
15,1,2.5,1510577970
17,1,4.5,1305696483
18,1,3.5,1455209816
19,1,4,965705637
21,1,3.5,1407618878
27,1,3,962685262
31,1,5,850466616
32,1,3,856736119
33,1,3,939647444
40,1,5,832058959
43,1,5,848993983
44,1,3,869251860
45,1,4,951170182
46,1,5,834787906
50,1,3,1514238116
54,1,3,830247330
57,1,5,965796031

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education