CS799作业代做、代写Python程序作业、代做Python编程作业、代写Data-Driven作业
CS799 - Data-Driven Development with Python Fall 2018 Programming Assignment 61Programming Assignment 6Getting startedReview class handouts and examples, work on the reading and practice assignments posted on the courseschedule. This assignment is designed to practice data manipulation with Pandas and plotting withMatplotlib.Programming Project: Plotting worth: 20 pointsCreate plots visualizing movie data.Data and program overviewIn this assignment you will be working with data on movies and people’s ratings of these movies. The taskwill be to create visualizations of the movie data.The following data will be provided using csv files: A table with movie information (IMDB.csv); we will call this the movie data. A table documenting the movie data columns (IMDB-dataDict.csv).The files are supplied in a zip file, which will create a data subfolder, when unpacked.Your program should produce two plots when it is run. The plots should follow the specification providedbelow. Note that creating the second plot will require your independent exploration of Matplotlib forgenerating a bar graph.Plot 1: Ratings by age groupThis plot displays the average ratings by voters in the four age groups identified in the data for a set ofmovies selected by the user. A sample is presented in the first figure in the sample interaction. The four agegroups are: voters under 18 (VotesU18 column), between 18 and 29 years old, inclusively (Votes1829 ),between 30 and 44, inclusively (Votes3044 ), and voters 45 and older (Votes45A ).To generate the plot, the user will first need to specify which movies data to include, as described below:Step 1. The program should ask how many movies should be included. Assume the user will enter a validnumber between 1 and the total number of movies in the data file.Step 2. The program should let the user pick movies by executing the following procedure for eachselection:a. Ask the user to specify a title keyword and identify the movies that have the keyword in the title (thesearch should be case insensitive).b. If there is a single movie with the provided keyword (as shown in the interaction, while selecting themovie for Plot 2), that movie becomes the selected movie. Otherwise, if there is more than one matching movie, all matching titles should be displayed, alongwith a 1-based number identifying each title (see interaction for Plot 1). The user should be invited toselect one of these titles by specifying a number (you may assume user input will be valid here). Thecorresponding movie becomes the selected movie.If there are no titles containing the specified keyword, the user should be asked to provide anotherkeyword and steps 2a and 2b must be repeated.Step 3. Save the plot as plot1.jpg file using plt.savefig() function.CS799 - Data-Driven Development with Python Fall 2018 Programming Assignment 62Other Plot 1 Requirements: different movie data must be shown in different colors, displaying a markedpoint for each of the four values, and a line, connecting the points. Axes must be clearly labeled and themovie title and genre must be displayed near the first point of the respective graph (see figure). The plotmust include a dashed grid and a title. See the sample interaction for an illustration.Plot 2: Percentage of raters within different gender-age groupsThe movie data contains eight columns specifying the number of female and male voters within each of theage groups identified in the description of Plot 1. We will refer to these columns as age-gender columns(they are titled CVotesU18M, CVotesU18F and so on). Note: the total sum of values in the age-gendercolumns does not equal the value supplied by the TotalVotes column; perhaps this is because the TotalVotescount also includes people who did not identify their age or gender, and thus are not accounted for by theage-gender columns. We will refer to the sum of values within the age-gender columns for each row as allvotes for the movie.Plot 2 displays a bar graph, showing what percentage of all votes for a movie are contributed by the specificage-gender group. As with Plot 1, the user must be allowed to select a movie, using the sample procedure asspecified in Step 2 of Plot 1 description, except run for a single movie. The plot must be saved by yourprogram as plot2.jpg.Other Plot 2 Requirements: Bars for different genders must be shown in different colors, with thecorresponding percentage value displayed clearly on top of the bar. Axes must be clearly labeled as shown,and the values along the x axis must be slanted by 30 degrees. Plot title must include the title of the movie.Refer to the sample interaction for an illustration.Required FunctionsInclude main(), function pickMovieWithKeyword() that will run the movie selection procedure described inStep 2 of Plot 1 description. Functions plot1() and plot2() should each generate and save the respectiveplot. Pick function parameters and return values as you see fit, and define other functions as needed.General Requirements You can assume that the provided file will have all of the columns involved in the requiredcomputations, but the number of records and order of columns may be different. Your program should have no code outside of function definitions, except for a single call to main()and definitions described in the next bullet. In order to make the code easier to modify for a different set of column names, define global variablesthat store the names of columns and use them throughout, e.g. TITLE = 'Title'. All file related operations must use device-independent handling of paths (use os.getcwd() andos.path.join() functions to create paths, instead of hardcoding them).Submission and GradingSubmit your code along with two image files that your program will generate for the input data containedin the sample interaction. Grading will be based on the accuracy (conforming to all the requirements andformat of the interaction), generality of code and the appropriate use of pandas/numpy/matplotlib resources(data structures and functions). Each plot will be worth 9 points and two points will be awarded forprogramming style.The sample interaction that follows demonstrates one full execution of the program with the generatedplots. Note that the location of the data file must be requested from the user first.CS799 - Data-Driven Development with Python Fall 2018 Programming Assignment 63Sample interactionPlease enter the name of the subfolder with the data file: dataPlot1: ratings by age groupHow many of the 118 movies would you like to consider? 3Select 3 moviesEnter movie keyword: gameWhich of the following movies would you like to pick (enter number)1 The Hunger Games: Catching Fire2 The Imitation Gameenter a number: 1Movie #1: 'The Hunger Games: Catching Fire'Enter movie keyword: girlWhich of the following movies would you like to pick (enter number)1 Gone Girl2 Me and Earl and the Dying Girl3 The Girl with the Dragon Tattooenter a number: 3Movie #2: 'The Girl with the Dragon Tattoo'Enter movie keyword: 12Which of the following movies would you like to pick (enter number)1 12 Years a Slave2 127 Hours3 Short Term 12Enter a number: 1Movie #3: '12 Years a Slave'http://www.6daixie.com/contents/3/2367.html--------------------------------------------------------------------------------------------------------------------------------Plot2: Percentage of raters within gender-age. Select a movie:Enter movie keyword: argoMovie #1: 'Argo'Created by Tamara Babaian on December 1, 2018
因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:
微信:codinghelp