In this project your team is working with both of the files we have worked with in the in-class labs on files:
- film_locations_with_id.csv
- sf_neighborhoods_with_centroid.csv
You will be creating a program that runs in the terminal and offers the user two reports they can select to run. The program should be in a loop and prompting them if they want to run another report. If they select “Yes”, you should clear the terminal of prior output and present the report options again. An example is shown below of one option for this menu.
Figure 11.10.1: Menu for Selecting the Report to Run
If your team elects to do either/both of the extra-credit options, there would be more than two reports (in the above screen capture the third report is an extra-credit option).
Team project
Each of the reports has a function with a required signature, meaning it has a specific name, specific parameters (of a specific type), and it has a specific return value (also of a specific type).
Required Report Options
Each of the reports has a function prior to its printing with a required signature, meaning it has a specific name, specific parameters (of a specific type), and it has a specific return value (also of a specific type). Each report also has too include specific output, but the formatting is up to your team to decide (an example is provided).
Decades Report
For each decade (e.g., 1920, 1930, … , 2010, 2020) in the film location data, this report determines the top five San Francisco neighborhoods used as movie or tv locations in that decade (the ranking is based on combined movie and tv locations) and then reports them in sorted order (descending), listing the the name of the neighborhood and the number of movie and tv locations. If neighborhoods have the same number of locations in a decade, they are sorted alphabetically in descending order. Following is a snippet of the output.
Figure 11.10.2: Snippet of the Decades Report
Required Function
For the decade report the required function is named generate_decades_report
and has the following signature:
Name: generate_decades_report
Parameters (in the listed order):
film_path
– path to the film location data as a stringneighborhood_path
– path to the neighborhood data as a string
Returns a list of lists where each line for the report would be a list. The list should with the following values in the order listed:
- 4-digit decade as a string
- Neighborhood name
- Number of distinct movies filmed in that neighborhood in that decade (integer)
- Number of distinct tv shows filmed in that neighborhood in that decade (integer)
Team project
The list should be sorted as follows:
- Decade year (e.g., 1920, 1930, … , 2010, 2020) in ascending order (earliest decade first).
- Within each decade by neighborhood in descending order based on combined count of total distinct movie and tv shows in that neighborhood.
- Within each decade, when neighborhoods have the same number of total movies and TV shows filmed there, in descending order based on the neighborhood name.
In the above description, a movie or tv show could be filmed in multiple neighborhoods and counts for each neighborhood, so each line of the film data file is used in calculating the top five neighborhoods.
Actor Report
For each actor in the film location file (regardless of whether they are actor1
, actor2
, or actor3
), determine what movies or TV shows they were in (for TV shows, different seasons and episodes are the same show). For each movie or show, determine what year it was (for TV shows there can be multiple years). For each movie or TV show, determine what distinct neighborhoods it was filmed in. The report includes every actor who was in 2 or more different movies or TV shows (sorted in descending order by the number they were in – so actors in more movies/shows are listed first).
For each actor, list the movies/shows they were in, sorted in ascending order by title, include the format (movie or tv), the year(s) where multiple years are shown as a range from earliest to latest, and the neighborhoods it was filmed in (as a semicolon-separated list). If a movie (for a given actor) was filmed in three or fewer neighborhoods, list all of them, otherwise, list the first 2 and then include “and X more” where X is the number of additional neighborhoods.
Following is a snippet from the report based on the full data.
Figure 11.10.3: Snippet of Actor Report
Required Function
For the actor report, the required function is named generate_actors_report
and has the following signature:
Name: generate_actors_report
Parameters (in the listed order):
film_path
– path to the film location data as a stringneighborhood_path
– path to the neighborhood data as a string
Team project
Returns a list of lists where each line for the report would be a list. The list should with the following values in the order listed:
- Actor’s name
- Movie (or TV show) title
- Format (‘movie’ or ‘tv’)
- Years as a string. If a single year, that year as a string. If the show included multiple years, the first and last years in sorted order separated by a dash (e.g., ‘2014 – 2016’).
- Neighborhoods as a semicolon-separated string. If the movie or tv was filmed in more than 3 neighborhoods (as listed for that actor), then the first two should be listed, followed by ‘and X more’ where X is the number of additional neighborhoods.
See Canvas for a discussion of the grading and extra-credit options.
Development of your team’s code MUST be done in zyBooks
To order this assignment click here or contact info@topgradeswriting.com