Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with these python code lines, thanks! Question 1.1. Construct a table Prinary_Charges with the columns Primary_Charge and Number_of_Charges that contains the five most

Please help with these python code lines, thanks! image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 1.1. Construct a table Prinary_Charges with the columns Primary_Charge and Number_of_Charges that contains the five most seen primary charges in the data, as well as how many times each of those primary charges occurred in the data. Question 1.3. Alcohol use seems to be prevelent in many of the five most seen charges. For the arrests with a primary charge of IMPAIRED DRIVING DWI , construct a histogram for the ages of those arrested. Your histogram should begin at the age of 18 , have bins 2 years wide, and range over all possible ages in the data. Question 1.4. What can you learn from this histogram? Specifically describe two features of the histogram. Write your answer here, replacing this text. Question 1.5. Is there a relationship between the average age for arrests depending on the type of arrest and if drugs or alcohol are present in the 27514 Zipcode? To answer this question, make a table. Arrest_types_drugs_or_alcohol, containing types of arrest as the rows, and the presence of drugs or alcohol as the columns, for the 27514 Zipcode. The values in the rows should correspond to the average age of those arrested for each combination of categories. Remove the rows with the Drugs_or_Alcohol_Present values of nan (blank) or U (unknown) as well as the column with the Type_of Arrest value nan (blank). Hint Run the cell below with the table and use this table to construct the required table for this question. In the Arrests table there are many blank values for the age of those arrested. These blanks may lead to issues when attempting this question. Also dropped is the Y column for lattitude, as it may cause confusion for some possible outputs. Note: Depending on how you go about answering this question, you may encounter a red box appearing below your code cell with a warning message. Don't worry too much about the message. Warnings are raised by Python when it encounters an unusual condition in your code, but the condition is not severe enough to warrant throwing an error. Note: Depending on how you go about answering this question, you may encounter a red box appearing below your code cell with a warning message. Don't worly too much about the message. Warnings are raised by Python when it encounters an unusual condition in your code, but the condition is not severe enough to warrant throwing an error

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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions