We begin by importing some helper functions.
from helper import *
Now, let's get the data from the List of helicopter prison escapes Wikipedia article.
url = "https://en.wikipedia.org/wiki/List_of_helicopter_prison_escapes"
data = data_from_url(url)
Let's print the first three rows
for i in range(0,3):
print(data[i])
['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 Contreras 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."]
index = 0
for row in data:
data[index] = row[:-2]
index += 1
for i in range(0,3):
print(data[i])
['August 19, 1971', 'Santa Martha Acatitla', 'Mexico', 'Yes'] ['October 31, 1973', 'Mountjoy Jail', 'Ireland', 'Yes'] ['May 24, 1978', 'United States Penitentiary, Marion', 'United States', 'No']
for row in data:
row[0] = fetch_year(row[0])
for i in range(0,3):
print(data[i])
[1971, 'Santa Martha Acatitla', 'Mexico', 'Yes'] [1973, 'Mountjoy Jail', 'Ireland', 'Yes'] [1978, 'United States Penitentiary, Marion', 'United States', 'No']
min_year = min(data, key=lambda x: x[0])[0]
max_year = max(data, key=lambda x: x[0])[0]
years = []
for year in range(min_year, max_year + 1):
years.append(year)
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]
data[0:100]
[[1971, 'Santa Martha Acatitla', 'Mexico', 'Yes'], [1973, 'Mountjoy Jail', 'Ireland', 'Yes'], [1978, 'United States Penitentiary, Marion', 'United States', 'No'], [1981, 'Fleury-Mérogis, Essonne, Ile de France', 'France', 'Yes'], [1981, 'Orsainville Prison, Quebec City', 'Canada', 'No'], [1983, 'Pentridge (HM Prison)', 'Australia', 'No'], [1985, 'Perry Correctional Institution, Pelzer, South Carolina', 'United States', 'Yes'], [1985, 'Cândido Mendes penitentiary, Ilha Grande, Rio de Janeiro', 'Brazil', 'Yes'], [1986, 'Prison de la Santé', 'France', 'Yes'], [1986, 'Federal Correctional Institution, Dublin', 'United States', 'Yes'], [1986, 'Prigione di Rebibbia, Roma', 'Italy', 'Yes'], [1987, 'Gartree (HM Prison)', 'United Kingdom', 'Yes'], [1988, 'Santa Fe prison', 'United States', 'Yes'], [1989, 'Federal Holding Facility, Miami, FL', 'United States', 'No'], [1989, 'Arkansas Valley Correctional Facility', 'United States', 'Yes'], [1990, 'Kent Penitentiary, British Columbia', 'Canada', 'Yes'], [1991, 'Rio Piedras State Penitentiary, Puerto Rico', 'Puerto Rico', 'Yes'], [1992, 'Lyon Prison', 'France', 'Yes'], [1992, 'Touraine Central Prison, Tours', 'France', 'No'], [1993, 'Touraine Central Prison, Tours', 'France', 'No'], [1996, 'High Security Prison, Santiago', 'Chile', 'Yes'], [1997, 'De Geerhorst jail', 'Netherlands', 'No'], [1999, 'Metropolitan Remand and Reception Centre', 'Australia', 'Yes'], [2000, 'Martin Treatment Center for Sexually Violent Predators, Martin County Florida', 'United States', 'Yes'], [2000, 'Lyon prison', 'France', 'Yes'], [2001, 'Luynes prison', 'France', 'Yes'], [2001, 'Draguignan prison', 'France', 'Yes'], [2001, 'Fresnes prison', 'France', 'No'], [2002, 'Parada Neto Penitentiary', 'Brazil', 'Yes'], [2002, 'Las Cucharas prison, Puerto Rico', 'United States', 'Yes'], [2003, 'Luynes prison', 'France', 'Yes'], [2005, 'France', 'France', 'No'], [2005, 'Aiton Prison', 'France', 'Yes'], [2006, 'Korydallos Prison', 'Greece', 'Yes'], [2007, 'Lantin Prison, Liège', 'Belgium', 'Yes'], [2007, 'Grasse prison', 'France', 'Yes'], [2007, 'Ittre prison', 'Belgium', 'No'], [2009, 'Korydallos Prison', 'Greece', 'Yes'], [2009, 'Domenjod Prison, Réunion', 'France', 'Yes'], [2009, 'Bruges', 'Belgium', 'Yes'], [2010, 'HM Prison Isle of Wight, Isle of Wight', 'United Kingdom', 'No'], [2012, 'Sheksna, Penal colony N17', 'Russia', 'Yes'], [2013, 'Trikala Prison, Trikala', 'Greece', 'No'], [2013, 'Saint-Jérôme Detention Facility, Quebec', 'Canada', 'Yes'], [2014, 'Orsainville Detention Facility, Quebec', 'Canada', 'Yes'], [2016, 'Thiva', 'Greece', 'No'], [2018, 'Réau, near Paris', 'France', 'Yes'], [2020, 'Forest prison, Brussels', 'Belgium', 'No']]
attempts = 0
attempts_per_year = []
for y in years:
for row in data:
if y == row[0]:
attempts += 1
if attempts != 0:
attempts_per_year.append([y,attempts])
attempts = 0
print(attempts_per_year)
[[1971, 1], [1973, 1], [1978, 1], [1981, 2], [1983, 1], [1985, 2], [1986, 3], [1987, 1], [1988, 1], [1989, 2], [1990, 1], [1991, 1], [1992, 2], [1993, 1], [1996, 1], [1997, 1], [1999, 1], [2000, 2], [2001, 3], [2002, 2], [2003, 1], [2005, 2], [2006, 1], [2007, 3], [2009, 3], [2010, 1], [2012, 1], [2013, 2], [2014, 1], [2016, 1], [2018, 1], [2020, 1]]
%matplotlib inline
barplot(attempts_per_year)
In which year did the most attempts at breaking out of prison with a helicopter occur?
3 attempts occured in 1986, 2001, 2007, 2009
countries_freq = df['Country'].value_counts()
print(countries_freq)
France 15 United States 8 Greece 4 Belgium 4 Canada 4 Brazil 2 United Kingdom 2 Australia 2 Italy 1 Chile 1 Netherlands 1 Puerto Rico 1 Ireland 1 Russia 1 Mexico 1 Name: Country, dtype: int64
print_pretty_table(countries_freq)
Country | Number of Occurrences |
---|---|
France | 15 |
United States | 8 |
Greece | 4 |
Belgium | 4 |
Canada | 4 |
Brazil | 2 |
United Kingdom | 2 |
Australia | 2 |
Italy | 1 |
Chile | 1 |
Netherlands | 1 |
Puerto Rico | 1 |
Ireland | 1 |
Russia | 1 |
Mexico | 1 |
In which country did the most attempts at breaking out of prison with a helicopter occur?
The most attempts occured in France
df.groupby('Country')['Succeeded'].value_counts().sort_values(ascending=False)
Country Succeeded France Yes 11 United States Yes 6 France No 4 Canada Yes 3 United States No 2 Greece Yes 2 Belgium No 2 Yes 2 Brazil Yes 2 Greece No 2 Ireland Yes 1 Italy Yes 1 Mexico Yes 1 Netherlands No 1 Chile Yes 1 Canada No 1 Puerto Rico Yes 1 Russia Yes 1 United Kingdom No 1 Yes 1 Australia Yes 1 No 1 Name: Succeeded, dtype: int64
df.groupby('Country')['Succeeded'].value_counts(normalize=True).sort_values(ascending=False)
Country Succeeded Russia Yes 1.000000 Puerto Rico Yes 1.000000 Netherlands No 1.000000 Mexico Yes 1.000000 Italy Yes 1.000000 Ireland Yes 1.000000 Brazil Yes 1.000000 Chile Yes 1.000000 Canada Yes 0.750000 United States Yes 0.750000 France Yes 0.733333 Greece No 0.500000 Australia Yes 0.500000 Belgium No 0.500000 Yes 0.500000 Australia No 0.500000 Greece Yes 0.500000 United Kingdom No 0.500000 Yes 0.500000 France No 0.266667 Canada No 0.250000 United States No 0.250000 Name: Succeeded, dtype: float64
In which countries do helicopter prison breaks have a higher chance of success?
Russia, Puerto Rico, Mexico, Italy, Ireland, Brazil and Chile all have a 100% success rate historically. Though, each of these countries has only experienced one such incident.
France and United States have experienced the most incidents (15 & 8 respectively) and have a success rate of 73% and 75% respectively.
Therefore, the countries with the highest rate of success would be France and United States, because there is not enough data for the other countries to determine a regularity in it's current high probability of success.