Question: python 3.6 and comment your work if possible Definitions CSV file: This is a file containing plain text where each line in the file represents




python 3.6 and comment your work if possible
Definitions CSV file: This is a file containing plain text where each line in the file represents one record of information, and each piece of info in the record is separated by a single comma. Luckily the values won't ever contain commas themselves for this project. But they might start or end with non visible characters (e.g. space, tab). Thus, you must remove the leading and trailing spaces when you store the data in a dictionary in memory. The very first line is the header row, which names the columns but is not part of the data, and therefore should not be loaded into memory. Note: the filename extension you use has no effect on the contents; you can edit it and give it any extension you want without changing the ability of your program. In this project we'l be using two kinds of CSV files: votes.csv file: It contains records of votes in the following format: state, candidate, party, popular_votes, electoral_votes AL, Johnson, IND, 44467, 0 AL, Stein, IND, 9391, 0 AK, Trump, REP, 163387, 9 VA, Clinton, DEM, 1981473, 13 Note: the total number of electoral votes in the file is 531 instead of 538 because 7 votes of the electoral college were not given as promised! abbreviations.csv file: It contains abbreviations of strings in the following format: abbreviation, full_string AL, Alabama AK, Alaska VA, Virginia Johnson, Gary Johnson Stein, Jill Stein IND, Independent REP, Republican DEM, Democratic For storage efficiency all files contain string abbreviations. When we load the files into memory we will also be using the same abbreviations for memory efficiency. But when we present results as output of the program we will be using the full strings. Definitions CSV file: This is a file containing plain text where each line in the file represents one record of information, and each piece of info in the record is separated by a single comma. Luckily the values won't ever contain commas themselves for this project. But they might start or end with non visible characters (e.g. space, tab). Thus, you must remove the leading and trailing spaces when you store the data in a dictionary in memory. The very first line is the header row, which names the columns but is not part of the data, and therefore should not be loaded into memory. Note: the filename extension you use has no effect on the contents; you can edit it and give it any extension you want without changing the ability of your program. In this project we'l be using two kinds of CSV files: votes.csv file: It contains records of votes in the following format: state, candidate, party, popular_votes, electoral_votes AL, Johnson, IND, 44467, 0 AL, Stein, IND, 9391, 0 AK, Trump, REP, 163387, 9 VA, Clinton, DEM, 1981473, 13 Note: the total number of electoral votes in the file is 531 instead of 538 because 7 votes of the electoral college were not given as promised! abbreviations.csv file: It contains abbreviations of strings in the following format: abbreviation, full_string AL, Alabama AK, Alaska VA, Virginia Johnson, Gary Johnson Stein, Jill Stein IND, Independent REP, Republican DEM, Democratic For storage efficiency all files contain string abbreviations. When we load the files into memory we will also be using the same abbreviations for memory efficiency. But when we present results as output of the program we will be using the full strings
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
