CITS1401 : Computational Thinking with Python The CSV File Containing Information - IT/Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

Overview

This project is an extension to Project 1 but has different requirements. As mentioned earlier that the year 2020 will be regarded as a pandemic year in the history of mankind. COVID19 impacted the entire world in such a manner that no other virus has ever done in the history. It’s been more than a year for the virus and still the uncertainties are looming all over the world. Center for Systems Science and Engineering at John Hopkins University is regularly gathering the data about the COVID-19 spread and publishing it regularly at https://ourworldindata.org/coronavirus-source-data. This data is sourced from governments, national and subnational agencies across the world and publicly available for researchers and analysts. In this project, you are required to write a computer program which can read the data from a csv (comma separated values) file provided to you and return different analytical results of the COVID-19 cases for entire world. Your program should follow the following specifications. CITS1401 Computational Thinking with Python Project 2 Semester 1 2021 Page 2 of 5 Specification: What your program will need to do Input: Your program must define the function main with the following signature: def main(csvfile):

The input arguments are:

• csvfile is the name of the CSV file containing information and record of the COVID-19 cases which needs to be analysed. The first row of the CSV file will contain the headers. From the second row, each row contains the corresponding data to its header. We do not have prior knowledge about the number of columns or rows available in the CSV file. Output: The function is required to return the following outputs in the order provided below:

• A dictionary containing the country name as key and a list having the following data about that country as value.

o A list containing the total number of recorded positive cases of COVID-19 for each month of the year. o A list containing the total number of recorded deaths due to COVID-19 for each month of the year.

o A list containing the total number of days for each month of year, when the recorded positive cases of COVID-19 for that month of the year were greater than the average recorded positive cases of that month of the year. o A list containing the total number of days for each month of year, when the recorded deaths due to COVID-19 for that month of the year were greater than the average deaths due to COVID-19 for that month of the year.

• A dictionary containing the continent name as key and a list having the data similar to above for each continent as value. All lists should have values recorded for each month of the year in order from January to December. All returned output variables must contain numerical values rounded to four decimal places (if required to be rounded off). Remember not to round the values during calculations and round them only at the time of saving them in the output variables.

Example: Download the Covid-data-for-project_2_sample.csv file from the folder of Project 2 on LMS or Moodle.

  • An example interactions are: >>> dict_country,dict_continent = main('Covid-data-for-project-2-sample.csv') The output returned are dictionaries where some data is presented below: >>> dict_country['afghanistan'] [[1963, 1, 174, 1952, 13081, 16020, 1681, 1494, 1109, 2157, 4849, 5252], [86, 0, 4, 60, 194, 482, 188, 119, 57, 78, 257, 396], [1, 1, 7, 11, 13, 16, 8, 11, 10, 14, 15, 18], [3, 0, 4, 12, 11, 13, 8, 15, 14, 15, 15, 16]] CITS1401 Computational Thinking with Python Project 2 Semester 1 2021 Page 3 of 5 >>> dict_country['italy'] [[169327, 1126, 104664, 99671, 27534, 7729, 6959, 21677, 45647, 364569, 922124, 505612], [4596, 29, 12399, 15539, 5448, 1383, 374, 342, 411, 2724, 16958, 18583], [8, 8, 17, 15, 11, 15, 14, 12, 15, 11, 15, 15], [6, 6, 14, 17, 12, 16, 13, 4, 15, 12, 15, 15]] >>> dict_continent.keys() dict_keys(['asia', 'europe', 'africa', 'north america', 'south america', 'oceania', '']) >>> dict_continent['oceania'] [[198, 16, 4534, 2207, 436, 718, 9360, 8539, 1277, 499, 317, 513], [0, 0, 18, 75, 10, 2, 97, 456, 231, 19, 1, 1], [10, 5, 10, 11, 13, 9, 14, 13, 13, 13, 10, 12], [0, 0, 12, 14, 10, 2, 11, 14, 10, 10, 1, 1]]

Additional requirements:

There are few more requirements for your program.

• Your program needs to validate the inputs to the main() function and gracefully terminate if invalid inputs are provided.

• You program needs to terminate gracefully if the file cannot be found or opened.

• For graceful terminations, you need to print the message related to the problem and return None for each output.

• Your program needs to validate the input data from the file. Date in the file is expected to be in day/month/year format otherwise entire row needs to be discarded. All numeric data is expected to be numeric and any other recorded data (or no data) should be considered as zero (0).

• Your program needs to consider that columns and rows of the csv file do not have any specific order or can be in any order (excluding header row).

• Your program needs to interpret the header row to find the required columns. Your program needs to terminate gracefully if required columns cannot be found in the file.

• Your program needs to convert all text data in the csv to be lower order alphabets.

• Your program needs to consider that data can be missed for few days of the month and therefore needs to find averages based on the available number of days for which correct data is available (for output related to countries), whereas for continents, the program can assume that data exists for all days of the month.

The above CITS1401  IT Assignment Help has been solved by our  IT Assignment  Experts at onlineassignmentbank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.