Introduction
Task 15-17 involves the processing of data loaded from a CSV file. This data contains information on Covid-19 cases and is stored in a list of records, where individual record is a list of information values. The goal is to implement several functions to process this data and return the desired results.
Task-15
Evaluating if the user carefully selected the option for data processing is the first step in task 15. If so, a notification indicating that the data analysis procedure is still in progress is displayed. A selection of options for dispensing the data is then displayed by the application (menu variant 1). The user can choose to fetch (many) records using observation dates, organize records by nation or area, or summarize the records.
The application asks the user to enter the record's serial number if the user chooses the choice to retrieve a specific record by serial number. The record is then shown after retrieving it using the process module's get_record_by_serial function and indicating that the record retrieving process has begun. Last but not least, it shows that the material retrieval procedure is finished.
The application asks the user to specify the beginning and ending observation dates if they choose to get (many) entries based on observation dates. It then shows that the records gathering process has begun, obtains the records to use the process module's get_records_by_date_range function, and displays the records that have been found. Last but not least, it shows that the records retrieving procedure is finished.
The program groups the information using the group_by_country_region function from of the process module and shows the groupings if the user chooses the choice to group by country region. The software then notifies that the grouping procedure has started. Last but not least, it shows that the grouping procedure is finished.
When the user chooses the option to summarize the records, the program starts the summary process, uses the summarise_records method from the process module to summarize the records, and presents the summary. Last but not least, it shows that the summary procedure is finished.
Task 16-17
Task 16-17 involves the implementation of the processing functions. The get_total_records function simply returns the length of the list of records. The get_record_by_serial function searches for a record with the specified serial number in the list of records and returns the record if found. If the record is not found, it returns None. The get_records_by_date_range function searches for records with observation dates within the specified range and returns the records as a list. The group_by_country_region function groups the records by country/region and returns a dictionary where the keys are country/region names and the values are lists of records for that country/region. Finally, the summarise_records function returns a summary of the records that includes the total number of confirmed cases, deaths, and recoveries for each country/region.
Overall, the implementation of these processing functions allows the program to effectively process the Covid-19 data and return the desired results.