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 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 17:40
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i.e., still have an asterisk in it).
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
The footer area of a web page generally houses which website feature? terms of use web page content business name or title menu headings
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-Γ -vis other ad-serving companies?
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
Questions on the website: 13722363