We begin by importing some helper functions.
[Introduction]: The purpose of this project is to analyze the helicopter prison escapes from 1971 to 2020.
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
index=0
for row in data:
data[index] = row[:-1]
index+=1
print(data[:10])
[['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"], ['May 24, 1978', 'United States Penitentiary, Marion', 'United States', 'No', 'Garrett Brock TrapnellMartin Joseph McNallyJames Kenneth Johnson'], ['February 27, 1981', 'Fleury-Mérogis, Essonne, Ile de France', 'France', 'Yes', 'Gérard DupréDaniel Beaumont'], ['May 7, 1981', 'Orsainville Prison, Quebec City', 'Canada', 'No', 'Marina Paquet (hijacker)Giles Arseneault (prisoner)'], ['January, 1983', 'Pentridge (HM Prison)', 'Australia', 'No', 'David McMillan'], ['December 19, 1985', 'Perry Correctional Institution, Pelzer, South Carolina', 'United States', 'Yes', 'James Rodney LeonardWilliam Douglas BallewJesse Glenn Smith'], ['December 31, 1985', 'Cândido Mendes penitentiary, Ilha Grande, Rio de Janeiro', 'Brazil', 'Yes', 'José Carlos dos Reis Encina, a.k.a. "Escadinha"'], ['May 26, 1986', 'Prison de la Santé', 'France', 'Yes', 'Michel Vaujour'], ['November 5, 1986', 'Federal Correctional Institution, Dublin', 'United States', 'Yes', 'Samantha Lopez']]
index=0
for row in data: # data doesn't include the details column
data[index][0]= fetch_year(row[0])
index+=1
print(data)
[[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)'], [1983, 'Pentridge (HM Prison)', 'Australia', 'No', 'David McMillan'], [1985, 'Perry Correctional Institution, Pelzer, South Carolina', 'United States', 'Yes', 'James Rodney LeonardWilliam Douglas BallewJesse Glenn Smith'], [1985, 'Cândido Mendes penitentiary, Ilha Grande, Rio de Janeiro', 'Brazil', 'Yes', 'José Carlos dos Reis Encina, a.k.a. "Escadinha"'], [1986, 'Prison de la Santé', 'France', 'Yes', 'Michel Vaujour'], [1986, 'Federal Correctional Institution, Dublin', 'United States', 'Yes', 'Samantha Lopez'], [1986, 'Prigione di Rebibbia, Roma', 'Italy', 'Yes', 'André BellaïcheGianluigi EspositoLuciano Cipollari'], [1987, 'Gartree (HM Prison)', 'United Kingdom', 'Yes', 'Sydney DraperJohn Kendall'], [1988, 'Santa Fe prison', 'United States', 'Yes', 'Mahoney Danny Francis MitchellRandy Lackey'], [1989, 'Federal Holding Facility, Miami, FL', 'United States', 'No', 'Ben Kramer'], [1989, 'Arkansas Valley Correctional Facility', 'United States', 'Yes', 'Ralph BrownFreddie Gonzales'], [1990, 'Kent Penitentiary, British Columbia', 'Canada', 'Yes', 'Robert FordDavid Thomas'], [1991, 'Rio Piedras State Penitentiary, Puerto Rico', 'Puerto Rico', 'Yes', 'William Lane'], [1992, 'Lyon Prison', 'France', 'Yes', '—'], [1992, 'Touraine Central Prison, Tours', 'France', 'No', '—'], [1993, 'Touraine Central Prison, Tours', 'France', 'No', 'Michel Vaujour'], [1996, 'High Security Prison, Santiago', 'Chile', 'Yes', 'Four members of the Manuel Rodriguez Patriotic Front'], [1997, 'De Geerhorst jail', 'Netherlands', 'No', '—'], [1999, 'Metropolitan Remand and Reception Centre', 'Australia', 'Yes', 'John Killick'], [2000, 'Martin Treatment Center for Sexually Violent Predators, Martin County Florida', 'United States', 'Yes', 'Steven Whitsett'], [2000, 'Lyon prison', 'France', 'Yes', '—'], [2001, 'Luynes prison', 'France', 'Yes', 'Pascal Payet'], [2001, 'Draguignan prison', 'France', 'Yes', 'Abdelhamid CarnousEmile Forma-SariJean-Philippe Lecase'], [2001, 'Fresnes prison', 'France', 'No', '—'], [2002, 'Parada Neto Penitentiary', 'Brazil', 'Yes', '—'], [2002, 'Las Cucharas prison, Puerto Rico', 'United States', 'Yes', 'Orlando Cartagena Jose Rodriguez Victor Diaz Hector Diaz Jose Tapia'], [2003, 'Luynes prison', 'France', 'Yes', 'Eric AlboreoFranck PerlettoMichel Valero'], [2005, 'France', 'France', 'No', '—'], [2005, 'Aiton Prison', 'France', 'Yes', 'Hubert SellesJean-Claude MorettiMohamed Bessame'], [2006, 'Korydallos Prison', 'Greece', 'Yes', 'Vassilis Paleokostas'], [2007, 'Lantin Prison, Liège', 'Belgium', 'Yes', 'Eric Ferdinand'], [2007, 'Grasse prison', 'France', 'Yes', 'Pascal Payet'], [2007, 'Ittre prison', 'Belgium', 'No', 'Nordin Benallal'], [2009, 'Korydallos Prison', 'Greece', 'Yes', 'Vasilis PaleokostasAlket Rizai'], [2009, 'Domenjod Prison, Réunion', 'France', 'Yes', 'Alexin JismyFabrice Michel'], [2009, 'Bruges', 'Belgium', 'Yes', 'Ashraf Sekkaki plus three other criminals'], [2010, 'HM Prison Isle of Wight, Isle of Wight', 'United Kingdom', 'No', 'Brian Lawrence'], [2012, 'Sheksna, Penal colony N17', 'Russia', 'Yes', 'Alexey Shestakov'], [2013, 'Trikala Prison, Trikala', 'Greece', 'No', 'Panagiotis Vlastos'], [2013, 'Saint-Jérôme Detention Facility, Quebec', 'Canada', 'Yes', 'Benjamin Hudon-BarbeauDanny Provençal'], [2014, 'Orsainville Detention Facility, Quebec', 'Canada', 'Yes', 'Yves DenisDenis LefebvreSerge Pomerleau'], [2016, 'Thiva', 'Greece', 'No', 'Pola RoupaNikos Maziotis'], [2018, 'Réau, near Paris', 'France', 'Yes', 'Rédoine Faïd'], [2020, 'Forest prison, Brussels', 'Belgium', 'No', 'Kristel A.']]
# 1) get all the years
min_year = min(data, key=lambda x: x[0])[0] # gets the min year per row
max_year = max(data, key=lambda x: x[0])[0]
print(min_year)
print(max_year)
years = []
for y in range(min_year, max_year+1): years.append(y)
print(years)
1971 2020 [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]
# 2)
attempts_per_year = []
for year in years:
attempts_per_year.append([year, 0])
# 3)
print(attempts_per_year)
[[1971, 0], [1972, 0], [1973, 0], [1974, 0], [1975, 0], [1976, 0], [1977, 0], [1978, 0], [1979, 0], [1980, 0], [1981, 0], [1982, 0], [1983, 0], [1984, 0], [1985, 0], [1986, 0], [1987, 0], [1988, 0], [1989, 0], [1990, 0], [1991, 0], [1992, 0], [1993, 0], [1994, 0], [1995, 0], [1996, 0], [1997, 0], [1998, 0], [1999, 0], [2000, 0], [2001, 0], [2002, 0], [2003, 0], [2004, 0], [2005, 0], [2006, 0], [2007, 0], [2008, 0], [2009, 0], [2010, 0], [2011, 0], [2012, 0], [2013, 0], [2014, 0], [2015, 0], [2016, 0], [2017, 0], [2018, 0], [2019, 0], [2020, 0]]
In the code above, I have created a for loop that will loop through every elemet from the years list and while doing so the consecetive years and the value 0 will be appended to the attempts_per_year list (array) until the end of the loop occurs. We are doing this because we want to record the number of occurences per year in the next screen.
# this loop increments the 0 by 1 everytime the condition evaluates to be true.
for row in data:
for ya in attempts_per_year:
y = ya[0]
if row[0] == y:
ya[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]]
From above I have recorded the number of occurences per year by incrementing the value zero by one using a condition to check everytime the year in the attempts_per_year list corresponds to the year in the data list.
%matplotlib inline
barplot(attempts_per_year)
With reference from the graph, the years 1986, 2001, 2007 and 2009 apppear to have the highest number of attempts.
countries_frequency = df["Country"].value_counts()
print(countries_frequency)
print(df)
France 15 United States 8 Greece 4 Belgium 4 Canada 4 United Kingdom 2 Brazil 2 Australia 2 Russia 1 Mexico 1 Chile 1 Ireland 1 Italy 1 Netherlands 1 Puerto Rico 1 Name: Country, dtype: int64 Date Prison name \ 0 August 19, 1971 Santa Martha Acatitla 1 October 31, 1973 Mountjoy Jail 2 May 24, 1978 United States Penitentiary, Marion 3 February 27, 1981 Fleury-Mérogis, Essonne, Ile de France 4 May 7, 1981 Orsainville Prison, Quebec City 5 January, 1983 Pentridge (HM Prison) 6 December 19, 1985 Perry Correctional Institution, Pelzer, South ... 7 December 31, 1985 Cândido Mendes penitentiary, Ilha Grande, Rio ... 8 May 26, 1986 Prison de la Santé 9 November 5, 1986 Federal Correctional Institution, Dublin 10 November 23, 1986 Prigione di Rebibbia, Roma 11 December 10, 1987 Gartree (HM Prison) 12 July 11, 1988 Santa Fe prison 13 April 17, 1989 Federal Holding Facility, Miami, FL 14 August 19, 1989 Arkansas Valley Correctional Facility 15 June 19, 1990 Kent Penitentiary, British Columbia 16 1991 Rio Piedras State Penitentiary, Puerto Rico 17 1992 Lyon Prison 18 December 1992 Touraine Central Prison, Tours 19 June 17, 1993 Touraine Central Prison, Tours 20 December 30, 1996 High Security Prison, Santiago 21 September 18, 1997 De Geerhorst jail 22 March 25, 1999 Metropolitan Remand and Reception Centre 23 June 5, 2000 Martin Treatment Center for Sexually Violent P... 24 2000 Lyon prison 25 2001 Luynes prison 26 March 24, 2001 Draguignan prison 27 May 28, 2001 Fresnes prison 28 January 17, 2002 Parada Neto Penitentiary 29 December 30, 2002 Las Cucharas prison, Puerto Rico 30 2003 Luynes prison 31 July 2005 France 32 December 10, 2005 Aiton Prison 33 June 6, 2006 Korydallos Prison 34 April 15, 2007 Lantin Prison, Liège 35 July 15, 2007 Grasse prison 36 October 28, 2007 Ittre prison 37 February 22, 2009 Korydallos Prison 38 April 27, 2009 Domenjod Prison, Réunion 39 July 23, 2009 Bruges 40 June 25, 2010 HM Prison Isle of Wight, Isle of Wight 41 March 22, 2012 Sheksna, Penal colony N17 42 February 24, 2013 Trikala Prison, Trikala 43 March 17, 2013 Saint-Jérôme Detention Facility, Quebec 44 June 7, 2014 Orsainville Detention Facility, Quebec 45 February 22, 2016 Thiva 46 July 1, 2018 Réau, near Paris 47 September 25, 2020 Forest prison, Brussels Country Succeeded \ 0 Mexico Yes 1 Ireland Yes 2 United States No 3 France Yes 4 Canada No 5 Australia No 6 United States Yes 7 Brazil Yes 8 France Yes 9 United States Yes 10 Italy Yes 11 United Kingdom Yes 12 United States Yes 13 United States No 14 United States Yes 15 Canada Yes 16 Puerto Rico Yes 17 France Yes 18 France No 19 France No 20 Chile Yes 21 Netherlands No 22 Australia Yes 23 United States Yes 24 France Yes 25 France Yes 26 France Yes 27 France No 28 Brazil Yes 29 United States Yes 30 France Yes 31 France No 32 France Yes 33 Greece Yes 34 Belgium Yes 35 France Yes 36 Belgium No 37 Greece Yes 38 France Yes 39 Belgium Yes 40 United Kingdom No 41 Russia Yes 42 Greece No 43 Canada Yes 44 Canada Yes 45 Greece No 46 France Yes 47 Belgium No Escapee(s) 0 Joel David Kaplan Carlos Antonio Contreras Castro 1 JB O'Hagan Seamus TwomeyKevin Mallon 2 Garrett Brock TrapnellMartin Joseph McNallyJam... 3 Gérard DupréDaniel Beaumont 4 Marina Paquet (hijacker)Giles Arseneault (pris... 5 David McMillan 6 James Rodney LeonardWilliam Douglas BallewJess... 7 José Carlos dos Reis Encina, a.k.a. "Escadinha" 8 Michel Vaujour 9 Samantha Lopez 10 André BellaïcheGianluigi EspositoLuciano Cipol... 11 Sydney DraperJohn Kendall 12 Mahoney Danny Francis MitchellRandy Lackey 13 Ben Kramer 14 Ralph BrownFreddie Gonzales 15 Robert FordDavid Thomas 16 William Lane 17 — 18 — 19 Michel Vaujour 20 Four members of the Manuel Rodriguez Patriotic... 21 — 22 John Killick 23 Steven Whitsett 24 — 25 Pascal Payet 26 Abdelhamid CarnousEmile Forma-SariJean-Philipp... 27 — 28 — 29 Orlando Cartagena Jose Rodriguez Victor Diaz H... 30 Eric AlboreoFranck PerlettoMichel Valero 31 — 32 Hubert SellesJean-Claude MorettiMohamed Bessame 33 Vassilis Paleokostas 34 Eric Ferdinand 35 Pascal Payet 36 Nordin Benallal 37 Vasilis PaleokostasAlket Rizai 38 Alexin JismyFabrice Michel 39 Ashraf Sekkaki plus three other criminals 40 Brian Lawrence 41 Alexey Shestakov 42 Panagiotis Vlastos 43 Benjamin Hudon-BarbeauDanny Provençal 44 Yves DenisDenis LefebvreSerge Pomerleau 45 Pola RoupaNikos Maziotis 46 Rédoine Faïd 47 Kristel A.
print_pretty_table(countries_frequency = df["Country"].value_counts())
Country | Number of Occurrences |
---|---|
France | 15 |
United States | 8 |
Greece | 4 |
Belgium | 4 |
Canada | 4 |
United Kingdom | 2 |
Brazil | 2 |
Australia | 2 |
Russia | 1 |
Mexico | 1 |
Chile | 1 |
Ireland | 1 |
Italy | 1 |
Netherlands | 1 |
Puerto Rico | 1 |
France and the United States have the highest attempted helicopter prison escapes.