Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi! So I'm really confused by my latest asignment question: In this assignment, you'll be exploring the database of Crime in Denver contained in this

Hi! So I'm really confused by my latest asignment question:

In this assignment, you'll be exploring the database of Crime in Denver contained in this zip file. The database contains two files

  1. offence_codes.csv: Is a CSV file that contains offence codes and information about each code

  2. crime.csv: Is a CSV file containing information about 455872 crimes reported in Denver, mostly occurring in 2018.

Begin by downloading a4.py which contains skeleton code that opens and reads the CSV files line-by-line, with an obvious place for you to add your code. Which I've done with no problem. Issue is I don't know what he means by the question: Write a function code_to_names(code) that takes an int crime code and returns a list of strings where each string contains the code extension and the full name of the crime. image text in transcribed This is just the first of many questions. Honestly I'd just really appreciate it if someone could explain to me where to start. What should I be trying to do here?

import csv # Question 1 def code_to_names (code) names [ with open ('offense codes.csv') as csv file: reader = csv. reader (csvfile, delimiter= ',') next (reader) # skip the first row for row in reader - pass # Your code goes here return names

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions