subject

Read file (fp) → D1, D2,D3:a) This function read a file pointer and returns 3 dictionaries: - Parameters:file pointer (fp) - Returns: 3 dictionaries of list of tuples - The function displays nothing b) You must use the csv. reader because some fields have commas in them. CSE 231 Spring 2020 c) Each row of the file contains the name of a video game, the platform which it was released, the release year, the genre (i. e. shooter, puzzle, rpg, fighter, etc.), the publishing company, and regional sales across north America, Europe, Japan, and other regions. For this project, we are only interested in the following columns: name = line [0] platform = line[1] year = int(line [2]). genre = line [3] publisher = line [4] na sales = float (line [5]) europe_sales = float (line [6]) japan_sales = float (line [7]) other sales = float (line [8]) d) All strings should be converted to lower case and stripped of the trailing/forward white spaces. e) Multiply each regional sales column by 1,000,000. The program must compute the total global sales by adding all the regional sales (na_sales, europe_sales, japan_sales, other_sales).f) This function returns 3 separate dictionaries. The first dictionary, with 'name' as key, will contain the data used to display the global sales per year or platform. The second dictionary, with 'genre' as key, contains the data used to display the regional sales per genre. The third dictionary, with 'publisher' as key, contains the data used to display the global sales by publisher. All of 3 dictionaries have a list of tuples as values: D1 = { name: [ (name, platform, year, genre, publisher, global_sales), ...), ...} D2 = { genre: [ (genre, year, na_sales, eur_sales, jpn_sales, other_sales, global_sales), ...), ...} D3 = {publisher: [(publisher, name, year, na_sales, eur_sales, jpn_sales, other_sales, global_sales), ...], ...) You should ignore all the values that are not valid: - 'year' should be integer (int) - All regional sales should be floats (floats). g) Once the file is read and all the data is stored in the 3 dictionaries, you need to sort each dictionary alphabetically in ascending order by their keys. The values for the 3 dictionaries should also be sorted by the last element of the tuples in reverse order (global_sales).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:50
A.) generate scaffolding to create database for your application. develop all the entities identified in assignment #2. add any additional that may be identified later. b.) add data validation rules to the models that are appropriate for your application and data. c.) create links for each scaffold in the header section. part 2: application updates [30 points] a.) add two additional views to the "home" controller you created in assignment #1. b.) the two views should be named as “privacy" and "". c.) link the two newly created views in the footer section. hint: you would need to modify the “home" controller definition and create “privacy.html.erb" and “.html.erb" files in appropriate locations.
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
question
Computers and Technology, 23.06.2019 22:50
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
You know the right answer?
Read file (fp) → D1, D2,D3:a) This function read a file pointer and returns 3 dictionaries: - Parame...
Questions
question
Mathematics, 13.12.2021 19:20
question
Mathematics, 13.12.2021 19:20
question
Mathematics, 13.12.2021 19:20
question
Engineering, 13.12.2021 19:20
question
Social Studies, 13.12.2021 19:20
Questions on the website: 13722363