Prison Helicopter Escapes

Summary

Following the number of prison helicopter escapes around the world, this project has been designed to answer the following questions.

  • How many helicopter prison attempts were recorded from 1971 till 2020?
  • How many attempts were successful? How many were unsuccessful?
  • In which year did the most attempts occur?
  • In which countries do the most attempts occur?
  • In which countries do helicopter prison breaks have a higher chance of success?
  • What prisons have escapees broken out of more than once?
  • How many escapees have done it more than once? How does the number of escapees affect the success?
  • In which month did the most successful attempts occur?

Find dataset here: https://en.wikipedia.org/wiki/List_of_helicopter_prison_escapes#Actual_attempts

FIRST STEP: Import helper functions
In [1]:
from helper import *
SECOND STEP: Get the data

Let's get the data from the list of prison helicopter breaks. Create a variable "url" to pull our dataset in. Assign another variable "data" to the helper function "data_from_url()".

In [2]:
url =('https://en.wikipedia.org/wiki/List_of_helicopter_prison_escapes')
In [3]:
data = data_from_url(url)

Print the first three rows to see the content of your dataset.

In [4]:
for row in data[:3]:
    print(row)
['August 19, 1971', 'Santa Martha Acatitla', 'Mexico', 'Yes', 'Joel David Kaplan Carlos Antonio Contreras Castro', "Joel David Kaplan was a New York businessman who had been arrested for murder in 1962 in Mexico City and was incarcerated at the Santa Martha Acatitla prison in the Iztapalapa borough of Mexico City. Joel's sister, Judy Kaplan, arranged the means to help Kaplan escape, and on August 19, 1971, a helicopter landed in the prison yard. The guards mistakenly thought this was an official visit. In two minutes, Kaplan and his cellmate Carlos Antonio Contreras, a Venezuelan counterfeiter, were able to board the craft and were piloted away, before any shots were fired.[9] Both men were flown to Texas and then different planes flew Kaplan to California and Castro to Guatemala.[3] The Mexican government never initiated extradition proceedings against Kaplan.[9] The escape is told in a book, The 10-Second Jailbreak: The Helicopter Escape of Joel David Kaplan.[4] It also inspired the 1975 action movie Breakout, which starred Charles Bronson and Robert Duvall.[9]"]
['October 31, 1973', 'Mountjoy Jail', 'Ireland', 'Yes', "JB O'Hagan Seamus TwomeyKevin Mallon", 'On October 31, 1973 an IRA member hijacked a helicopter and forced the pilot to land in the exercise yard of Dublin\'s Mountjoy Jail\'s D Wing at 3:40\xa0p.m., October 31, 1973. Three members of the IRA were able to escape: JB O\'Hagan, Seamus Twomey and Kevin Mallon. Another prisoner who also was in the prison was quoted as saying, "One shamefaced screw apologised to the governor and said he thought it was the new Minister for Defence (Paddy Donegan) arriving. I told him it was our Minister of Defence leaving." The Mountjoy helicopter escape became Republican lore and was immortalized by "The Helicopter Song", which contains the lines "It\'s up like a bird and over the city. There\'s three men a\'missing I heard the warder say".[1]']
['May 24, 1978', 'United States Penitentiary, Marion', 'United States', 'No', 'Garrett Brock TrapnellMartin Joseph McNallyJames Kenneth Johnson', "43-year-old Barbara Ann Oswald hijacked a Saint Louis-based charter helicopter and forced the pilot to land in the yard at USP Marion. While landing the aircraft, the pilot, Allen Barklage, who was a Vietnam War veteran, struggled with Oswald and managed to wrestle the gun away from her. Barklage then shot and killed Oswald, thwarting the escape.[10] A few months later Oswald's daughter hijacked TWA Flight 541 in an effort to free Trapnell."]
THIRD STEP: Manipulate the data

We might not need the information in the last column for our analysis so we get rid of it.

In [5]:
index=0
for row in data:
    data[index]= row[:-1]
    index+=1

Print the first few rows to confirm that you got rid of the last column

In [6]:
print(data[:2])
[['August 19, 1971', 'Santa Martha Acatitla', 'Mexico', 'Yes', 'Joel David Kaplan Carlos Antonio Contreras Castro'], ['October 31, 1973', 'Mountjoy Jail', 'Ireland', 'Yes', "JB O'Hagan Seamus TwomeyKevin Mallon"]]

We want to also extract just the year in the date column so we use the "fetch_year()" function. Print the first few rows to confirm

In [7]:
for row in data:
    row[0]= fetch_year(row[0])
print(data[:5])
    
    
[[1971, 'Santa Martha Acatitla', 'Mexico', 'Yes', 'Joel David Kaplan Carlos Antonio Contreras Castro'], [1973, 'Mountjoy Jail', 'Ireland', 'Yes', "JB O'Hagan Seamus TwomeyKevin Mallon"], [1978, 'United States Penitentiary, Marion', 'United States', 'No', 'Garrett Brock TrapnellMartin Joseph McNallyJames Kenneth Johnson'], [1981, 'Fleury-Mérogis, Essonne, Ile de France', 'France', 'Yes', 'Gérard DupréDaniel Beaumont'], [1981, 'Orsainville Prison, Quebec City', 'Canada', 'No', 'Marina Paquet (hijacker)Giles Arseneault (prisoner)']]

Let's get the range of years too!

In [8]:
min_year = min(data, key=lambda x: x[0])[0]
max_year = max(data, key=lambda x: x[0])[0]
In [9]:
print(min_year)
print(max_year)
1971
2020

Create a list of the years. Print the first few rows to confirm.

In [10]:
years = []
for y in range(min_year, max_year +1):
    years.append(y)
In [11]:
print(years)
[1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020]

Compute the number of attempts per year.

In [12]:
attempts_per_year = []
for year in years:
    attempts_per_year.append([year, 0])
In [13]:
for row in data:
    for each in attempts_per_year:
        y = each[0]
        if row[0] == y:
            each[1] += 1
            
print(attempts_per_year)    
[[1971, 1], [1972, 0], [1973, 1], [1974, 0], [1975, 0], [1976, 0], [1977, 0], [1978, 1], [1979, 0], [1980, 0], [1981, 2], [1982, 0], [1983, 1], [1984, 0], [1985, 2], [1986, 3], [1987, 1], [1988, 1], [1989, 2], [1990, 1], [1991, 1], [1992, 2], [1993, 1], [1994, 0], [1995, 0], [1996, 1], [1997, 1], [1998, 0], [1999, 1], [2000, 2], [2001, 3], [2002, 2], [2003, 1], [2004, 0], [2005, 2], [2006, 1], [2007, 3], [2008, 0], [2009, 3], [2010, 1], [2011, 0], [2012, 1], [2013, 2], [2014, 1], [2015, 0], [2016, 1], [2017, 0], [2018, 1], [2019, 0], [2020, 1]]
FOURTH STEP: Data Analysis

Libraries: I start by importing a list of libraries necessary for analysis and graphical representation.

I worked with these list of libraries.

  • plotly.graph_objects as go
  • plotly.express as px
  • numpy as np
  • pandas as pd
Question 1: How many helicopter prison attempts were recorded from 1971 till 2020?
In [14]:
print(len(data))
48

Answer: The total number of attempts recorded was 48.

Question 2: How many attempts were successful? How many were unsuccessful?
In [15]:
attempts_frequency = df["Succeeded"].value_counts()

I decided to plot a donut pie chart to represent the number of successful and unsuccessful attempts.

In [16]:
import plotly.graph_objects as go
import plotly.offline as pyo

# Set notebook mode to work in offline
pyo.init_notebook_mode()
labels = ['Successful','Unsuccessful']
values = attempts_frequency

fig = go.Figure(data=[go.Pie(labels=labels, values=values, textinfo='label+percent',
                             insidetextorientation='radial',hole=.4,
                            )])
fig.update_layout(
    title_text="Prison Helicopter Break Attempts (1971-2020)",
    # Add annotations in the center of the donut pies.
    annotations=[dict(text='Attempts', x=0.5, y=0.5, font_size=20, showarrow=False)])
        
fig.show()