Question: Python Problem 1. Top Movies and Actors This problem is about analyzing data from IMDB lists with top rated and top grossing movies. There are

Python

Problem 1. Top Movies and Actors This problem is about analyzing data from IMDB lists with top rated and top grossing movies. There are these files linked from the Homework 4 Canvas page: imdb-top-rated.csv, listing the ranking of the top rated 250 movies. It has this format: Rank,Title,Year,IMDB Rating imdb-top-grossing.csv, listing the ranking of the highest grossing 250 movies. It has this format: Rank,Title,Year,USA Box Office imdb-top-casts.csv, listing the director and cast for the movies in the above files. It has this format: Title,Year, Director, Actor 1, Actor 2, Actor 3, Actor 4, Actor 5. The actors are listed in billing order. This file does not have a heading. These files are from Duke U. and seem to date from 2014. Write a program in file p1.py that does the following: a) Displays a ranking (descending) of the movie directors with the most movies in the top rated list. Print only the top 5 directors, with a proper title above. b) Displays a ranking (descending) of the directors with the most movies in the top grossing list. Print only the top 5 directors, with a proper title above. c) Displays a ranking (descending) of the actors with the most movie credits from the top rated list. Print only the top 5 actors, with a proper title above. d)Displays a ranking of movies (descending) based on a combined rating/grossing score. The score for a movie with rating rank r and grossing rank g is 500-r-g. Exclude movies that are only on one list and not on the other. Print only the top 5 movie titles, with their year, with a proper title above. e) Displays a ranking (descending) with the actors who brought in the most box office money, based on the top grossing movie list. For a movie with gross ticket sales amount s, the 5 actors on the cast list will split amount s in the following way: Actor # 1 (first billed) 2 3 4 5 $$ per actor 16*s/31 8*s/31 4*s/31 2*s/31 s/31 Print only the top 5 actor pairs, with a proper title above. EXTRA CREDIT 5 points: f) Displays in order the top 10 grossing actor pairs that played together in the same movie. The total amount (used for sorting) for a pair of actors is the sum of the gross revenue allocated to each actor with the scheme in the table above, but computed only for movies where the two actors played together. We can expect Harrison Ford and Mark Hamill to be near the top, since they were together in the original Star Wars movies. Take a screenshot of the programs output (a-e + f) and insert it in the h4.doc file right after the code from file p1.py. Design and Implementation Requirements To get credit for this problem, follow these requirements: a) Apply the top-down design methodology. Seek commonality among the tasks listed above. Break the problems into subproblems divide&conquer-style, then write functions dealing with the subproblems. b) Compute and use 3 dictionaries with the key in the form of a tuple (movie_name, movie_year) for storing movie cast information, ratings info, and gross info, respectively. We need to include the year as part of the key since its possible in principle to get two different movies with the same title, but it is less likely to be from the same year. Use a dictionary for storing actor information with the key being the actor name and value being the list of (movie_name, movie_year) tuples for movies in which they played, and any other data needed, such as gross allocated (per the table above). Store multiple values for one entry in a tuple or list.

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!