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 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
Answers: 2
question
Computers and Technology, 25.06.2019 04:00
Plz there is a problem with my account. i no longer have ! ( hand,ambitious,virtuoso etc.) it's like getting brainliest means nothing. how do i get ranks back?
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Two technicians are discussing a resistance measurement. technician a states that components being measured should be removed or isolated from the circuit. technician b states that power to the circuit should be disconnected when measuring resistance. which technician is correct?
Answers: 1
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, 08.01.2021 17:40
question
Mathematics, 08.01.2021 17:40
question
English, 08.01.2021 17:40
question
Mathematics, 08.01.2021 17:40
question
Mathematics, 08.01.2021 17:40
question
Mathematics, 08.01.2021 17:40
Questions on the website: 13722363