Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given a CSV file from the NY Times COVID - 1 9 Data Tracking project, read the contents of the colleges file then locate the
Given a CSV file from the NY Times COVID Data Tracking project, read the contents of the colleges file then locate the information regarding the number of reported cases at for the schools in the specified state and county.
Update the function processbycountystate county for the following:
Import the CSV module and read the file colleges.csv
Loop and process the data from the file for the following:
Use the state and county columns to filter the needed schools.
Store the date column in a variable so you can adjust the formatting to be MMDDYYYY
Use the cases and cases column as the value add together the total number of cases for and
If the school is from the selected state and county, output the sentence from one of the following example sentences based on the available data as a single string:
Cases only in : As of MMDDYYYY COLLEGE NAME reported YY cases of COVID in
Cases only in : As of MMDDYYYY COLLEGE NAME reported YY cases of COVID in
Cases in & : As of MMDDYYYY COLLEGE NAME reported YY cases of COVID in and
No Cases Reported: As of MMDDYYYY COLLEGE NAME reported no cases of COVID in or
Test in your terminal using command line arguments to ensure the program passes the provided test cases found in the TESTS.md file.
Tips
Function processbycounty does not return any values, it only prints the resulting sentence one school at a time.
Data may or may not be present in the cases and cases columns, use appropriate exception handling before adding.
The sentence in the print statement should be a single string statement, no commas separating values.
Some values in the CSV may be modified from the original to ensure you are correctly parsing the data as requested.
Some counties have the same name in multiple states so it is important to filter by state and county.
You may want to research how to use the csvDictReader method to make things easier.
You may view the provided expected test result JSON file, but using it in your program code will result in zero points being awarded.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started