Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In [183]: non_death_penalty_states = make_array ( 'Alaska' , 'Hawaii', 'Maine', 'M ichigan' , 'Wisconsin', 'Minnesota' ) def had_death_penalty_in_1971(state): Returns True if the argument is the

image text in transcribed
image text in transcribed
In [183]: non_death_penalty_states = make_array ( 'Alaska' , 'Hawaii', 'Maine', 'M ichigan' , 'Wisconsin', 'Minnesota' ) def had_death_penalty_in_1971(state): """Returns True if the argument is the name of a state that had he death penalty in 1971."" # The implementation of this function uses a bit of syntax # we haven't seen before. Just trust that it behaves as its # documentation claims. return state not in non_death_penalty_states states = murder_rates . group ( 'State' ) . select ( 'State' ) death penalty = states. with_column( 'Death Penalty', states . apply (had death_penalty_in_1971, 0) ) death penalty Out [183] : State Death Penalty Alabama True Alaska False Arizona True Arkansas True California True Colorado True Connecticut True Delaware True Florida True Georgia True (40 rows omitted)

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

Research Methods Design And Analysis

Authors: Larry Christensen

13th Edition

0205961258, 978-0205961252

More Books

Students also viewed these Economics questions

Question

List and briefly describe five reasons for the study of history.

Answered: 1 week ago

Question

1. Avoid conflicts in the relationship

Answered: 1 week ago

Question

1. What will happen in the future

Answered: 1 week ago