Park University 1928 to 2011 Infectious Diseases Lab 9 Assignment
Park University 1928 to 2011 Infectious Diseases Lab 9 Assignment
Below is what I need assistance with:
- Download the following all to the same folder:
- The program Lab9-start.py
- The data files health-no-head-sample.csv and health-no-head.csv
The big data file contains records of some infectious diseases from 1928 to 2011. The small one only includes data from 3 years from 5 states. Run the python program. It should print something like thisMEASLES,206.98,COLORADO,2099,1014000,1928_x000D_ _x000D_ ['MEASLES', '206.98', 'COLORADO', '2099', '1014000', '1928n']_x000D_ MEASLES,634.95,CONNECTICUT,10014,1577000,1928 _x000D_ _x000D_ ['MEASLES', '634.95', 'CONNECTICUT', '10014', '1577000', '1928n']_x000D_ MEASLES,256.02,DELAWARE,597,233000,1928_x000D_ _x000D_ ['MEASLES', '256.02', 'DELAWARE', '597', '233000', '1928n']_x000D_ ...
- Make sure that you get output like this before starting the assignment or writing any additional code.
Directions
Modify the program in the following ways:
- Write each line as part of a table, include a header before the table, and a summary line at the end. Use a fixed width for each column (don’t try to find the largest width like you did in the previous unit). You should end up with something like
State Disease Number Year_x000D_ _x000D_ COLORADO MEASLES 2,099 1928_x000D_ CONNECTICUT MEASLES 10,014 1928_x000D_ DELAWARE MEASLES 597 1928_x000D_ …_x000D_ DELAWARE SMALLPOX 0 1930_x000D_ DISTRICT OF COLUMBIA SMALLPOX 0 1930_x000D_ FLORIDA SMALLPOX 28 1930_x000D_ Total 52,307Not every field of the original line is used in the output. You will have to do some research about the .format() function to print the number of cases with a comma. If you can’t get the comma in the number column, move on and come back to that once you have more of the program written. The key is to have all the columns line up.
- Use some if statements to add three filters to your program that let the user select exactly one state, disease and year to include in the report. Prompt the user to enter these values.
Enter state: Colorado_x000D_ Enter disease: smallpox_x000D_ Enter year: 1928_x000D_ State Disease Number Year_x000D_ _x000D_ COLORADO SMALLPOX 340 1928_x000D_ Total 340Unfortunately, this isn’t very flexible.
- Change your program so that if the user just hits return for a prompt, the program includes all the data for that field. For example:
Enter state (Empty means all): Colorado_x000D_ Enter disease (Empty means all):_x000D_ Enter year (Empty means all): 1928_x000D_ State Disease Number Year_x000D_ _x000D_ COLORADO MEASLES 2,099 1928_x000D_ COLORADO POLIO 71 1928_x000D_ COLORADO SMALLPOX 340 1928_x000D_ Total 2,510Your program should run as expected using this small data set
- Change the open statement in the program to use the full data set, health-no-head.csv.
- Write down the answers to the following queries:
- How many cases of Hepatitis A were reported in Utah in 2001?
- How many cases of polio have been reported in California?
- How many cases of all diseases were reported in 1956?
- Add another feature to your program.
This could be something like printing the highest and lowest numbers for each query, or allowing the user to just type the first part of value, so that entering 20 for the year generates a table for years 2000, 2001, 2002, … 2011, or entering D for a state gives information on Delaware and the District of Columbia. Or maybe leverage your previous assignment and make the column only as wide as they need to be for the data. Try to make it something useful. - Comment your code.
Be sure to add a header comment to your program and any functions, and appropriate comments before other blocks of code.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..



