(d) create_area_dict(list2D) that takes a 2D-list containing the database as input and creates a dictionary called area_dict (you may rename it), where keys are the identity number of a CMA (ID) and values are the name of the CMA (Area). This function must return the dictionary. See sample output below. area_dict = create_area_dict(database) display_dict(area_dict) 31 - Cityview - Crestview - Meadowlands 903 - Billings Bridge - Alta Vista 908 - Byward Market 912 Carson Grove - Carson Meadows 923 - Glebe - Dows Lake 940 - Overbrook - McArthur 942 949 Portobello South Sandy Hill West Centertown 957

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
icon
Concept explainers
Question
(d) create_area_dict(list2D) that takes a 2D-list containing the database as input and
creates a dictionary called area_dict (you may rename it), where keys are the identity
number of a CMA (ID) and values are the name of the CMA (Area). This function must
return the dictionary. See sample output below.
area_dict = create_area_dict(database)
display_dict(area_dict)
31 - Cityview - Crestview - Meadowlands
903 - Billings Bridge - Alta Vista
908 - Byward Market
912
Carson Grove
Carson Meadows
923
Glebe - Dows Lake
940
Overbrook - McArthur
942 - Portobello South
949 - Sandy Hill
957 - West Centertown
(e) create_crime_dict(filename) that takes the filename of a csv file as input and
returns a dictionary called crime_dict (you may rename it). This function reads the
header of the csv file and stores data in crime_dict such that keys are the indices of a
crime type on the header row, and values are the corresponding crime types (names are
case sensitive). You can assume that indices start from zero (0) on the header row. The
function must return this dictionary. See sample output below.
crime_dict = create_area_dict(filename)
display_dict(crime_dict)
3 - Arson
4 - Break and Enter
5 - Fraud
6 -
Mischief
7 - Possession / Trafficking Stolen Goods
8 - Theft - Motor Vehicle
9 - Theft $5000 and Under
Theft Over $5000
10 -
Transcribed Image Text:(d) create_area_dict(list2D) that takes a 2D-list containing the database as input and creates a dictionary called area_dict (you may rename it), where keys are the identity number of a CMA (ID) and values are the name of the CMA (Area). This function must return the dictionary. See sample output below. area_dict = create_area_dict(database) display_dict(area_dict) 31 - Cityview - Crestview - Meadowlands 903 - Billings Bridge - Alta Vista 908 - Byward Market 912 Carson Grove Carson Meadows 923 Glebe - Dows Lake 940 Overbrook - McArthur 942 - Portobello South 949 - Sandy Hill 957 - West Centertown (e) create_crime_dict(filename) that takes the filename of a csv file as input and returns a dictionary called crime_dict (you may rename it). This function reads the header of the csv file and stores data in crime_dict such that keys are the indices of a crime type on the header row, and values are the corresponding crime types (names are case sensitive). You can assume that indices start from zero (0) on the header row. The function must return this dictionary. See sample output below. crime_dict = create_area_dict(filename) display_dict(crime_dict) 3 - Arson 4 - Break and Enter 5 - Fraud 6 - Mischief 7 - Possession / Trafficking Stolen Goods 8 - Theft - Motor Vehicle 9 - Theft $5000 and Under Theft Over $5000 10 -
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Linked List
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