get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
(PYTHON)
 
a) get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the
integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary.
(Suppose we want to know the total number of cases reported on each date, so use x = 0.)
>>> result, total_cases = get_total_cases(database, 0)
>>> display_dict(result)
2021-05-19: 8
2021-05-20: 2
2021-05-21: 1
2021-05-22: 1
>>> print(total_cases)
12
 
 
Case Repo Age_Group Client_Gen Reporting Reporting Reporting Reporting Reporting Reporting
#####HA# 40s
MALE
2241 Kingston Fr Kingston K7M 1V5 www.kflap
44.2
MALE
2265 Region of VWaterloo N2J 4V3
43.5
FEMALE
2244 Middlesex-London
www.healt
4913 Southwest St. Thomas N5P 1G9 www.swpu
N6A 5L7
43
MALE
42.8
FEMALE
2251 Ottawa Pul Ottawa
K2G 6J8
www.ottav
www.healt
45.3
FEMALE
2244 Middlesex-London
N6A 5L7
43
GENDER DI
3895 Toronto Pu Toronto
M5B 1W2 www.toror
43.7
MALE
2237 Hamilton P Hamilton L8P 4S6
2268 Windsor-EsWindsor
www.hami
43.3
MALE
N9A 4J8
2270 York RegioiNewmarke L3Y 6Z1
www.wech
42.3
MALE
44
www.york,
2253 Peel Public Mississaug: L5W 1N4 www.peelr
FEMALE
43.6
UNSPECIFIE
3895 Toronto Pu Toronto
M5B 1W2 www.toror
43.7
Transcribed Image Text:Case Repo Age_Group Client_Gen Reporting Reporting Reporting Reporting Reporting Reporting #####HA# 40s MALE 2241 Kingston Fr Kingston K7M 1V5 www.kflap 44.2 MALE 2265 Region of VWaterloo N2J 4V3 43.5 FEMALE 2244 Middlesex-London www.healt 4913 Southwest St. Thomas N5P 1G9 www.swpu N6A 5L7 43 MALE 42.8 FEMALE 2251 Ottawa Pul Ottawa K2G 6J8 www.ottav www.healt 45.3 FEMALE 2244 Middlesex-London N6A 5L7 43 GENDER DI 3895 Toronto Pu Toronto M5B 1W2 www.toror 43.7 MALE 2237 Hamilton P Hamilton L8P 4S6 2268 Windsor-EsWindsor www.hami 43.3 MALE N9A 4J8 2270 York RegioiNewmarke L3Y 6Z1 www.wech 42.3 MALE 44 www.york, 2253 Peel Public Mississaug: L5W 1N4 www.peelr FEMALE 43.6 UNSPECIFIE 3895 Toronto Pu Toronto M5B 1W2 www.toror 43.7
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education