{ "cells": [ { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Program Files\\Python_Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:18: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", "C:\\Program Files\\Python_Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:19: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DateTypeLocationDetailsPerpetratorPart ofdeadinjured
11ShootingIstanbul, Turkey2017 Istanbul nightclub shooting: One gunman k...Islamic StateTurkey–ISIL conflict39.070.0
21BombingHerat, AfghanistanAt least six people were hurt in an explosion ...TalibanWar in Afghanistan0.06.0
31ShootingBujumbura, BurundiThe Burundian environmental minister Emmanuel ...Lone wolfBurundian unrest1.00.0
41BombingQuetta, PakistanFour Frontier Corps security personnel and two...Lashkar-e-Jhangvi (suspected)Sectarianism in Pakistan0.06.0
51AssassinationMa'an, JordanThe Islamic State claimed responsibility for a...Islamic StateSpillover of the Syrian Civil War1.00.0
62Suicide car bombingsBaghdad, IraqJanuary 2017 Baghdad bombings: A series of car...Islamic StateIraqi Civil War56.0122.0
72Suicide car bombingMogadishu, SomaliaJanuary 2017 Mogadishu bombings: A suicide car...Al-ShabaabSomali Civil War7.017.0
82Suicide bombingsSamarra, IraqGunmen wearing suicide vests attacked two poli...Islamic StateIraqi Civil War7.0NaN
93AssassinationCairo, EgyptA Christian businessman was murdered by a Sala...Lone wolfNaN1.00.0
103ShootingAbyan, YemenThree Yemeni soldiers were killed and 10 other...Al-Qaeda in the Arabian PeninsulaAl-Qaeda insurgency in Yemen3.010.0
113ShootingBadakhshan, AfghanistanA Taliban ambush in the northeastern Badakhsha...TalibanWar in Afghanistan4.00.0
123ShootingBria, Central African RepublicMoroccan UN peacekeepers were ambushed by assa...Anti-balaka (suspected)Central African Republic Civil War2.02.0
134ShootingQuetta, PakistanUnknown gunmen killed two government officials...Lashkar-e-Jhangvi (suspected)Sectarianism in Pakistan2.00.0
144Car bombingMogadishu, SomaliaA car bomb attack injured four United Nations ...Al-ShabaabSomali Civil War0.04.0
154Jailbreak, shootoutKidapawan, Philippines2017 Kidapawan jail siege: Around 100 gunmen a...Bangsamoro Islamic Freedom Fighters (suspected)Moro conflict2.01.0
164Attempted suicide bombingsMadagali, NigeriaThree female suicide bombers were killed while...Boko HaramBoko Haram insurgency0.00.0
174ShootingKunduz, AfghanistanTwo US service members were killed and two oth...TalibanWar in Afghanistan2.02.0
184ShootingNawa, AfghanistanA policewoman was shot dead in the Nawa distri...TalibanWar in Afghanistan1.00.0
194ShootingBío Bío, ChileAt least five people were injured in an armed ...MapucheMapuche conflict0.05.0
205Suicide car bombing, Car bombingBaghdad, IraqA car bombing at a food market in the al-Obeid...Islamic State (suspected)Iraqi Civil War27.057.0
215Car bombingJableh, SyriaA car bomb exploded in the coastal city of Jab...Islamic State (suspected)Syrian Civil War16.030.0
225Car bombing, shootingIzmir, Turkey2017 İzmir Courthouse Attack: A car bomb explo...Kurdistan Freedom Falcons[29]Kurdish–Turkish conflict2.010.0
235StabbingAshdod, IsraelA man was stabbed for speaking Arabic.[30]Lone wolfIsraeli–Palestinian conflict0.01.0
245BombingGothenburg, SwedenA bomb exploded outside a refugee centre. An i...Nordic Resistance Movement (suspected)Terrorism in Sweden0.01.0
256Suicide bombings, Car bombingAd-Dawr, IraqA police checkpoint near Tikrit was attacked b...Islamic StateIraqi Civil War4.012.0
266ShootingQuetta, PakistanFive members of the Hazara Shia community were...Lashkar-e-JhangviSectarianism in Pakistan0.05.0
276StabbingMonufia, EgyptTwo Egyptian Coptic Christians were murdered. ...Lone wolfNaN2.00.0
286ExecutionRaqqa, SyriaIslamic State militants beheaded an elderly ma...Islamic StateSyrian Civil War1.00.0
296ShootingTala wa Barfak, AfghanistanGunmen shot dead at least 13 miners belonging ...Taliban (suspected)War in Afghanistan13.03.0
306ShootingFort Lauderdale, United Statesshooting attack at Fort Lauderdale Airport [38]Lone wolfTerrorism in the United States5.06.0
...........................
10326BombingMarada, LibyaMilitants of the Islamic State attacked one of...Islamic StateLibyan Civil War (2014–present)0.00.0
10426Bombing, ShootingNarathiwat Province, ThailandAt least six thai rangers and a civilian woman...Barisan Revolusi Nasional (suspected)South Thailand insurgency0.07.0
10526ShootdownHama Province, SyrianA group of terrorists attacked and shot down a...Tahrir al-ShamSyrian Civil war1.00.0
10627Bombing, ShootingBaghdad, IraqAt one government militiamen was killed and ot...Islamic StateIraqi insurgency1.05.0
10727Suicide car bombingLashkargah, AfghanistanOne army soldier and an assailant were killed ...TalibanWar in Afghanistan1.014.0
10827BombingSt. Petersburg, Russia2017 Perekrestok supermarket bombing: At least...Islamic State (suspected)Terrorism in Russia0.018.0
10928Suicide bombing, BombingsKabul, AfghanistanDecember 2017 Kabul suicide bombing: A suicide...Islamic StateWar in Afghanistan50.080.0
11028BombingSeyhan, TurkeyAn explosion apparently targeted a police stat...PKK (suspected)Kurdish–Turkish conflict0.00.0
11128Suicide BombingBorno State, NigeriaA suicide bombing caused by a Boko Haram milit...Boko HaramBoko Haram insurgency6.013.0
11228Bombing, shootingNorth Sinai Governorate, EgyptTwo persons, a police officer and a civilian, ...Islamic State (suspected)Sinai insurgency8.0NaN
11329ShootingsCairo, Egypt2017 Saint Menas church attack: Eleven people ...Islamic StateTerrorism in Egypt11.010.0
11429ShootingDiyala province, IraqA tribal figure was killed in an attack by Isl...Islamic StateIraqi insurgency1.00.0
11529Grenade attackCaucasia, Colombia43 people were injured when two attackers thre...FARC dissidents (suspected)Colombian conflict0.043.0
11629KidnappingCauca Department, ColombiaA 62 years old farmer was kidnapped by members...FARC DissidentsColombian conflict0.01.0
11730Shooting, arsonBorno State, NigeriaBoko Haram fighters opened fire on a group of ...Boko HaramBoko Haram insurgency25.0NaN
11830Car bombingMazar-i-Sharif, AfghanistanAt least twelve people were wounded in an expl...Taliban (suspected)War in Afghanistan0.012.0
11930ArsonDantewada IndiaAt least seven vehicles being used to road con...CPINaxalite-Maoist insurgency0.00.0
12030ShootingTarragona, PhilippinasAt least two soldiers were wounded in an ambus...New People’s ArmyCPP-NPA-NDF rebellion0.02.0
12130BombingAhvaz, IranThe salafist group Ansar Al-Furqan claimed res...Ansar Al-FurqanArab separatism in Khuzestan0.00.0
12231BombingMogadishu, SomaliaAt least two people, including a Somali soldie...Al-ShabaabWar in Somalia2.0NaN
12331Grenade attack, shootingPulwama district, IndiaFive troopers were killed and three sustained ...Jaish-e-MohammedInsurgency in Jammu and Kashmir5.03.0
12431BombingJalalabad, AfghanistanAn explosion at a funeral in Afghanistan's res...Islamic State (suspected)War in Afghanistan18.013.0
12531Suicide bombingFar North, CameroonAt least two people were killed and 30 more we...Boko HaramBoko Haram insurgency2.030.0
12631BombingLogar, AfghanistanFive Afghan police officers were killed when a...TalibanWar in Afghanistan5.0NaN
12731ShootingKohistan District, AfghanistanTaliban militants allegedly shot dead six memb...TalibanWar in Afghanistan6.00.0
12831BombingMaguindanao, PhilippinesA police officer was killed while five others ...Bangsamoro Islamic Freedom FightersMoro conflict1.05.0
12931BombingTacurong, PhilippinesTwo people were killed and 16 others were inju...Bangsamoro Islamic Freedom FightersMoro conflict2.016.0
13031Suicide bombingDeir ez-Zor Governorate, SyriaThe Islamic State terrorist group has carried ...Islamic StateSyrian Civil War20.050.0
13131ShootingGiza, EgyptAt least three militants of the Hasm Movement ...Hasm MovementInsurgency in Egypt0.00.0
13231Mortar attackKhmeimim, SyriaTwo Russian soldiers were killed in a mortar a...Islamic State (suspected)Syrian Civil War2.010.0
\n", "

1625 rows × 8 columns

\n", "
" ], "text/plain": [ " Date Type Location \\\n", "1 1 Shooting Istanbul, Turkey \n", "2 1 Bombing Herat, Afghanistan \n", "3 1 Shooting Bujumbura, Burundi \n", "4 1 Bombing Quetta, Pakistan \n", "5 1 Assassination Ma'an, Jordan \n", "6 2 Suicide car bombings Baghdad, Iraq \n", "7 2 Suicide car bombing Mogadishu, Somalia \n", "8 2 Suicide bombings Samarra, Iraq \n", "9 3 Assassination Cairo, Egypt \n", "10 3 Shooting Abyan, Yemen \n", "11 3 Shooting Badakhshan, Afghanistan \n", "12 3 Shooting Bria, Central African Republic \n", "13 4 Shooting Quetta, Pakistan \n", "14 4 Car bombing Mogadishu, Somalia \n", "15 4 Jailbreak, shootout Kidapawan, Philippines \n", "16 4 Attempted suicide bombings Madagali, Nigeria \n", "17 4 Shooting Kunduz, Afghanistan \n", "18 4 Shooting Nawa, Afghanistan \n", "19 4 Shooting Bío Bío, Chile \n", "20 5 Suicide car bombing, Car bombing Baghdad, Iraq \n", "21 5 Car bombing Jableh, Syria \n", "22 5 Car bombing, shooting Izmir, Turkey \n", "23 5 Stabbing Ashdod, Israel \n", "24 5 Bombing Gothenburg, Sweden \n", "25 6 Suicide bombings, Car bombing Ad-Dawr, Iraq \n", "26 6 Shooting Quetta, Pakistan \n", "27 6 Stabbing Monufia, Egypt \n", "28 6 Execution Raqqa, Syria \n", "29 6 Shooting Tala wa Barfak, Afghanistan \n", "30 6 Shooting Fort Lauderdale, United States \n", ".. ... ... ... \n", "103 26 Bombing Marada, Libya \n", "104 26 Bombing, Shooting Narathiwat Province, Thailand \n", "105 26 Shootdown Hama Province, Syrian \n", "106 27 Bombing, Shooting Baghdad, Iraq \n", "107 27 Suicide car bombing Lashkargah, Afghanistan \n", "108 27 Bombing St. Petersburg, Russia \n", "109 28 Suicide bombing, Bombings Kabul, Afghanistan \n", "110 28 Bombing Seyhan, Turkey \n", "111 28 Suicide Bombing Borno State, Nigeria \n", "112 28 Bombing, shooting North Sinai Governorate, Egypt \n", "113 29 Shootings Cairo, Egypt \n", "114 29 Shooting Diyala province, Iraq \n", "115 29 Grenade attack Caucasia, Colombia \n", "116 29 Kidnapping Cauca Department, Colombia \n", "117 30 Shooting, arson Borno State, Nigeria \n", "118 30 Car bombing Mazar-i-Sharif, Afghanistan \n", "119 30 Arson Dantewada India \n", "120 30 Shooting Tarragona, Philippinas \n", "121 30 Bombing Ahvaz, Iran \n", "122 31 Bombing Mogadishu, Somalia \n", "123 31 Grenade attack, shooting Pulwama district, India \n", "124 31 Bombing Jalalabad, Afghanistan \n", "125 31 Suicide bombing Far North, Cameroon \n", "126 31 Bombing Logar, Afghanistan \n", "127 31 Shooting Kohistan District, Afghanistan \n", "128 31 Bombing Maguindanao, Philippines \n", "129 31 Bombing Tacurong, Philippines \n", "130 31 Suicide bombing Deir ez-Zor Governorate, Syria \n", "131 31 Shooting Giza, Egypt \n", "132 31 Mortar attack Khmeimim, Syria \n", "\n", " Details \\\n", "1 2017 Istanbul nightclub shooting: One gunman k... \n", "2 At least six people were hurt in an explosion ... \n", "3 The Burundian environmental minister Emmanuel ... \n", "4 Four Frontier Corps security personnel and two... \n", "5 The Islamic State claimed responsibility for a... \n", "6 January 2017 Baghdad bombings: A series of car... \n", "7 January 2017 Mogadishu bombings: A suicide car... \n", "8 Gunmen wearing suicide vests attacked two poli... \n", "9 A Christian businessman was murdered by a Sala... \n", "10 Three Yemeni soldiers were killed and 10 other... \n", "11 A Taliban ambush in the northeastern Badakhsha... \n", "12 Moroccan UN peacekeepers were ambushed by assa... \n", "13 Unknown gunmen killed two government officials... \n", "14 A car bomb attack injured four United Nations ... \n", "15 2017 Kidapawan jail siege: Around 100 gunmen a... \n", "16 Three female suicide bombers were killed while... \n", "17 Two US service members were killed and two oth... \n", "18 A policewoman was shot dead in the Nawa distri... \n", "19 At least five people were injured in an armed ... \n", "20 A car bombing at a food market in the al-Obeid... \n", "21 A car bomb exploded in the coastal city of Jab... \n", "22 2017 İzmir Courthouse Attack: A car bomb explo... \n", "23 A man was stabbed for speaking Arabic.[30] \n", "24 A bomb exploded outside a refugee centre. An i... \n", "25 A police checkpoint near Tikrit was attacked b... \n", "26 Five members of the Hazara Shia community were... \n", "27 Two Egyptian Coptic Christians were murdered. ... \n", "28 Islamic State militants beheaded an elderly ma... \n", "29 Gunmen shot dead at least 13 miners belonging ... \n", "30 shooting attack at Fort Lauderdale Airport [38] \n", ".. ... \n", "103 Militants of the Islamic State attacked one of... \n", "104 At least six thai rangers and a civilian woman... \n", "105 A group of terrorists attacked and shot down a... \n", "106 At one government militiamen was killed and ot... \n", "107 One army soldier and an assailant were killed ... \n", "108 2017 Perekrestok supermarket bombing: At least... \n", "109 December 2017 Kabul suicide bombing: A suicide... \n", "110 An explosion apparently targeted a police stat... \n", "111 A suicide bombing caused by a Boko Haram milit... \n", "112 Two persons, a police officer and a civilian, ... \n", "113 2017 Saint Menas church attack: Eleven people ... \n", "114 A tribal figure was killed in an attack by Isl... \n", "115 43 people were injured when two attackers thre... \n", "116 A 62 years old farmer was kidnapped by members... \n", "117 Boko Haram fighters opened fire on a group of ... \n", "118 At least twelve people were wounded in an expl... \n", "119 At least seven vehicles being used to road con... \n", "120 At least two soldiers were wounded in an ambus... \n", "121 The salafist group Ansar Al-Furqan claimed res... \n", "122 At least two people, including a Somali soldie... \n", "123 Five troopers were killed and three sustained ... \n", "124 An explosion at a funeral in Afghanistan's res... \n", "125 At least two people were killed and 30 more we... \n", "126 Five Afghan police officers were killed when a... \n", "127 Taliban militants allegedly shot dead six memb... \n", "128 A police officer was killed while five others ... \n", "129 Two people were killed and 16 others were inju... \n", "130 The Islamic State terrorist group has carried ... \n", "131 At least three militants of the Hasm Movement ... \n", "132 Two Russian soldiers were killed in a mortar a... \n", "\n", " Perpetrator \\\n", "1 Islamic State \n", "2 Taliban \n", "3 Lone wolf \n", "4 Lashkar-e-Jhangvi (suspected) \n", "5 Islamic State \n", "6 Islamic State \n", "7 Al-Shabaab \n", "8 Islamic State \n", "9 Lone wolf \n", "10 Al-Qaeda in the Arabian Peninsula \n", "11 Taliban \n", "12 Anti-balaka (suspected) \n", "13 Lashkar-e-Jhangvi (suspected) \n", "14 Al-Shabaab \n", "15 Bangsamoro Islamic Freedom Fighters (suspected) \n", "16 Boko Haram \n", "17 Taliban \n", "18 Taliban \n", "19 Mapuche \n", "20 Islamic State (suspected) \n", "21 Islamic State (suspected) \n", "22 Kurdistan Freedom Falcons[29] \n", "23 Lone wolf \n", "24 Nordic Resistance Movement (suspected) \n", "25 Islamic State \n", "26 Lashkar-e-Jhangvi \n", "27 Lone wolf \n", "28 Islamic State \n", "29 Taliban (suspected) \n", "30 Lone wolf \n", ".. ... \n", "103 Islamic State \n", "104 Barisan Revolusi Nasional (suspected) \n", "105 Tahrir al-Sham \n", "106 Islamic State \n", "107 Taliban \n", "108 Islamic State (suspected) \n", "109 Islamic State \n", "110 PKK (suspected) \n", "111 Boko Haram \n", "112 Islamic State (suspected) \n", "113 Islamic State \n", "114 Islamic State \n", "115 FARC dissidents (suspected) \n", "116 FARC Dissidents \n", "117 Boko Haram \n", "118 Taliban (suspected) \n", "119 CPI \n", "120 New People’s Army \n", "121 Ansar Al-Furqan \n", "122 Al-Shabaab \n", "123 Jaish-e-Mohammed \n", "124 Islamic State (suspected) \n", "125 Boko Haram \n", "126 Taliban \n", "127 Taliban \n", "128 Bangsamoro Islamic Freedom Fighters \n", "129 Bangsamoro Islamic Freedom Fighters \n", "130 Islamic State \n", "131 Hasm Movement \n", "132 Islamic State (suspected) \n", "\n", " Part of dead injured \n", "1 Turkey–ISIL conflict 39.0 70.0 \n", "2 War in Afghanistan 0.0 6.0 \n", "3 Burundian unrest 1.0 0.0 \n", "4 Sectarianism in Pakistan 0.0 6.0 \n", "5 Spillover of the Syrian Civil War 1.0 0.0 \n", "6 Iraqi Civil War 56.0 122.0 \n", "7 Somali Civil War 7.0 17.0 \n", "8 Iraqi Civil War 7.0 NaN \n", "9 NaN 1.0 0.0 \n", "10 Al-Qaeda insurgency in Yemen 3.0 10.0 \n", "11 War in Afghanistan 4.0 0.0 \n", "12 Central African Republic Civil War 2.0 2.0 \n", "13 Sectarianism in Pakistan 2.0 0.0 \n", "14 Somali Civil War 0.0 4.0 \n", "15 Moro conflict 2.0 1.0 \n", "16 Boko Haram insurgency 0.0 0.0 \n", "17 War in Afghanistan 2.0 2.0 \n", "18 War in Afghanistan 1.0 0.0 \n", "19 Mapuche conflict 0.0 5.0 \n", "20 Iraqi Civil War 27.0 57.0 \n", "21 Syrian Civil War 16.0 30.0 \n", "22 Kurdish–Turkish conflict 2.0 10.0 \n", "23 Israeli–Palestinian conflict 0.0 1.0 \n", "24 Terrorism in Sweden 0.0 1.0 \n", "25 Iraqi Civil War 4.0 12.0 \n", "26 Sectarianism in Pakistan 0.0 5.0 \n", "27 NaN 2.0 0.0 \n", "28 Syrian Civil War 1.0 0.0 \n", "29 War in Afghanistan 13.0 3.0 \n", "30 Terrorism in the United States 5.0 6.0 \n", ".. ... ... ... \n", "103 Libyan Civil War (2014–present) 0.0 0.0 \n", "104 South Thailand insurgency 0.0 7.0 \n", "105 Syrian Civil war 1.0 0.0 \n", "106 Iraqi insurgency 1.0 5.0 \n", "107 War in Afghanistan 1.0 14.0 \n", "108 Terrorism in Russia 0.0 18.0 \n", "109 War in Afghanistan 50.0 80.0 \n", "110 Kurdish–Turkish conflict 0.0 0.0 \n", "111 Boko Haram insurgency 6.0 13.0 \n", "112 Sinai insurgency 8.0 NaN \n", "113 Terrorism in Egypt 11.0 10.0 \n", "114 Iraqi insurgency 1.0 0.0 \n", "115 Colombian conflict 0.0 43.0 \n", "116 Colombian conflict 0.0 1.0 \n", "117 Boko Haram insurgency 25.0 NaN \n", "118 War in Afghanistan 0.0 12.0 \n", "119 Naxalite-Maoist insurgency 0.0 0.0 \n", "120 CPP-NPA-NDF rebellion 0.0 2.0 \n", "121 Arab separatism in Khuzestan 0.0 0.0 \n", "122 War in Somalia 2.0 NaN \n", "123 Insurgency in Jammu and Kashmir 5.0 3.0 \n", "124 War in Afghanistan 18.0 13.0 \n", "125 Boko Haram insurgency 2.0 30.0 \n", "126 War in Afghanistan 5.0 NaN \n", "127 War in Afghanistan 6.0 0.0 \n", "128 Moro conflict 1.0 5.0 \n", "129 Moro conflict 2.0 16.0 \n", "130 Syrian Civil War 20.0 50.0 \n", "131 Insurgency in Egypt 0.0 0.0 \n", "132 Syrian Civil War 2.0 10.0 \n", "\n", "[1625 rows x 8 columns]" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas\n", "from datetime import datetime\n", "import numpy\n", "\n", "def _process_count(x):\n", " for i in range(len(x)+1, 0,-1):\n", " try:\n", " return int(x[0:i])\n", " except ValueError:\n", " pass\n", " return numpy.nan\n", "\n", "def load_month(m):\n", " results = pandas.read_html('https://en.wikipedia.org/wiki/List_of_terrorist_incidents_in_' + m + '_2017')\n", " df = results[0]\n", " df.columns = df[0:1].values[0]\n", " df = df[1:].copy()\n", " df['dead'] = df['Dead'].apply(_process_count)\n", " df['injured'] = df['Injured'].apply(_process_count)\n", " return df.drop(['Dead', 'Injured'], axis='columns').copy()\n", "\n", "data = []\n", "for month in [datetime(2008, i, 1).strftime('%B') for i in range(1,13)]:\n", " data.append(load_month(month))\n", "data = pandas.concat(data)\n", "data" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DateTypeLocationDetailsPerpetratorPart ofdeadinjuredconfirmedperpetrator_cleaned
11ShootingIstanbul, Turkey2017 Istanbul nightclub shooting: One gunman k...Islamic StateTurkey–ISIL conflict39.070.0TrueIslamic State
21BombingHerat, AfghanistanAt least six people were hurt in an explosion ...TalibanWar in Afghanistan0.06.0TrueTaliban
31ShootingBujumbura, BurundiThe Burundian environmental minister Emmanuel ...Lone wolfBurundian unrest1.00.0TrueLone wolf
41BombingQuetta, PakistanFour Frontier Corps security personnel and two...Lashkar-e-Jhangvi (suspected)Sectarianism in Pakistan0.06.0FalseLashkar-e-Jhangvi
51AssassinationMa'an, JordanThe Islamic State claimed responsibility for a...Islamic StateSpillover of the Syrian Civil War1.00.0TrueIslamic State
62Suicide car bombingsBaghdad, IraqJanuary 2017 Baghdad bombings: A series of car...Islamic StateIraqi Civil War56.0122.0TrueIslamic State
72Suicide car bombingMogadishu, SomaliaJanuary 2017 Mogadishu bombings: A suicide car...Al-ShabaabSomali Civil War7.017.0TrueAl-Shabaab
82Suicide bombingsSamarra, IraqGunmen wearing suicide vests attacked two poli...Islamic StateIraqi Civil War7.0NaNTrueIslamic State
93AssassinationCairo, EgyptA Christian businessman was murdered by a Sala...Lone wolfNaN1.00.0TrueLone wolf
103ShootingAbyan, YemenThree Yemeni soldiers were killed and 10 other...Al-Qaeda in the Arabian PeninsulaAl-Qaeda insurgency in Yemen3.010.0TrueAl-Qaeda
113ShootingBadakhshan, AfghanistanA Taliban ambush in the northeastern Badakhsha...TalibanWar in Afghanistan4.00.0TrueTaliban
123ShootingBria, Central African RepublicMoroccan UN peacekeepers were ambushed by assa...Anti-balaka (suspected)Central African Republic Civil War2.02.0FalseAnti-balaka
134ShootingQuetta, PakistanUnknown gunmen killed two government officials...Lashkar-e-Jhangvi (suspected)Sectarianism in Pakistan2.00.0FalseLashkar-e-Jhangvi
144Car bombingMogadishu, SomaliaA car bomb attack injured four United Nations ...Al-ShabaabSomali Civil War0.04.0TrueAl-Shabaab
154Jailbreak, shootoutKidapawan, Philippines2017 Kidapawan jail siege: Around 100 gunmen a...Bangsamoro Islamic Freedom Fighters (suspected)Moro conflict2.01.0FalseBangsamoro Islamic Freedom Fighters
164Attempted suicide bombingsMadagali, NigeriaThree female suicide bombers were killed while...Boko HaramBoko Haram insurgency0.00.0TrueBoko Haram
174ShootingKunduz, AfghanistanTwo US service members were killed and two oth...TalibanWar in Afghanistan2.02.0TrueTaliban
184ShootingNawa, AfghanistanA policewoman was shot dead in the Nawa distri...TalibanWar in Afghanistan1.00.0TrueTaliban
194ShootingBío Bío, ChileAt least five people were injured in an armed ...MapucheMapuche conflict0.05.0TrueMapuche
205Suicide car bombing, Car bombingBaghdad, IraqA car bombing at a food market in the al-Obeid...Islamic State (suspected)Iraqi Civil War27.057.0FalseIslamic State
215Car bombingJableh, SyriaA car bomb exploded in the coastal city of Jab...Islamic State (suspected)Syrian Civil War16.030.0FalseIslamic State
225Car bombing, shootingIzmir, Turkey2017 İzmir Courthouse Attack: A car bomb explo...Kurdistan Freedom Falcons[29]Kurdish–Turkish conflict2.010.0TrueKurdistan Freedom Falcons[29]
235StabbingAshdod, IsraelA man was stabbed for speaking Arabic.[30]Lone wolfIsraeli–Palestinian conflict0.01.0TrueLone wolf
245BombingGothenburg, SwedenA bomb exploded outside a refugee centre. An i...Nordic Resistance Movement (suspected)Terrorism in Sweden0.01.0FalseNordic Resistance Movement
256Suicide bombings, Car bombingAd-Dawr, IraqA police checkpoint near Tikrit was attacked b...Islamic StateIraqi Civil War4.012.0TrueIslamic State
266ShootingQuetta, PakistanFive members of the Hazara Shia community were...Lashkar-e-JhangviSectarianism in Pakistan0.05.0TrueLashkar-e-Jhangvi
276StabbingMonufia, EgyptTwo Egyptian Coptic Christians were murdered. ...Lone wolfNaN2.00.0TrueLone wolf
286ExecutionRaqqa, SyriaIslamic State militants beheaded an elderly ma...Islamic StateSyrian Civil War1.00.0TrueIslamic State
296ShootingTala wa Barfak, AfghanistanGunmen shot dead at least 13 miners belonging ...Taliban (suspected)War in Afghanistan13.03.0FalseTaliban
306ShootingFort Lauderdale, United Statesshooting attack at Fort Lauderdale Airport [38]Lone wolfTerrorism in the United States5.06.0TrueLone wolf
.................................
10326BombingMarada, LibyaMilitants of the Islamic State attacked one of...Islamic StateLibyan Civil War (2014–present)0.00.0TrueIslamic State
10426Bombing, ShootingNarathiwat Province, ThailandAt least six thai rangers and a civilian woman...Barisan Revolusi Nasional (suspected)South Thailand insurgency0.07.0FalseBarisan Revolusi Nasional
10526ShootdownHama Province, SyrianA group of terrorists attacked and shot down a...Tahrir al-ShamSyrian Civil war1.00.0TrueTahrir al-Sham
10627Bombing, ShootingBaghdad, IraqAt one government militiamen was killed and ot...Islamic StateIraqi insurgency1.05.0TrueIslamic State
10727Suicide car bombingLashkargah, AfghanistanOne army soldier and an assailant were killed ...TalibanWar in Afghanistan1.014.0TrueTaliban
10827BombingSt. Petersburg, Russia2017 Perekrestok supermarket bombing: At least...Islamic State (suspected)Terrorism in Russia0.018.0FalseIslamic State
10928Suicide bombing, BombingsKabul, AfghanistanDecember 2017 Kabul suicide bombing: A suicide...Islamic StateWar in Afghanistan50.080.0TrueIslamic State
11028BombingSeyhan, TurkeyAn explosion apparently targeted a police stat...PKK (suspected)Kurdish–Turkish conflict0.00.0FalsePKK
11128Suicide BombingBorno State, NigeriaA suicide bombing caused by a Boko Haram milit...Boko HaramBoko Haram insurgency6.013.0TrueBoko Haram
11228Bombing, shootingNorth Sinai Governorate, EgyptTwo persons, a police officer and a civilian, ...Islamic State (suspected)Sinai insurgency8.0NaNFalseIslamic State
11329ShootingsCairo, Egypt2017 Saint Menas church attack: Eleven people ...Islamic StateTerrorism in Egypt11.010.0TrueIslamic State
11429ShootingDiyala province, IraqA tribal figure was killed in an attack by Isl...Islamic StateIraqi insurgency1.00.0TrueIslamic State
11529Grenade attackCaucasia, Colombia43 people were injured when two attackers thre...FARC dissidents (suspected)Colombian conflict0.043.0FalseFARC dissidents
11629KidnappingCauca Department, ColombiaA 62 years old farmer was kidnapped by members...FARC DissidentsColombian conflict0.01.0TrueFARC Dissidents
11730Shooting, arsonBorno State, NigeriaBoko Haram fighters opened fire on a group of ...Boko HaramBoko Haram insurgency25.0NaNTrueBoko Haram
11830Car bombingMazar-i-Sharif, AfghanistanAt least twelve people were wounded in an expl...Taliban (suspected)War in Afghanistan0.012.0FalseTaliban
11930ArsonDantewada IndiaAt least seven vehicles being used to road con...CPINaxalite-Maoist insurgency0.00.0TrueCPI
12030ShootingTarragona, PhilippinasAt least two soldiers were wounded in an ambus...New People’s ArmyCPP-NPA-NDF rebellion0.02.0TrueNew People’s Army
12130BombingAhvaz, IranThe salafist group Ansar Al-Furqan claimed res...Ansar Al-FurqanArab separatism in Khuzestan0.00.0TrueAnsar Al-Furqan
12231BombingMogadishu, SomaliaAt least two people, including a Somali soldie...Al-ShabaabWar in Somalia2.0NaNTrueAl-Shabaab
12331Grenade attack, shootingPulwama district, IndiaFive troopers were killed and three sustained ...Jaish-e-MohammedInsurgency in Jammu and Kashmir5.03.0TrueJaish-e-Mohammed
12431BombingJalalabad, AfghanistanAn explosion at a funeral in Afghanistan's res...Islamic State (suspected)War in Afghanistan18.013.0FalseIslamic State
12531Suicide bombingFar North, CameroonAt least two people were killed and 30 more we...Boko HaramBoko Haram insurgency2.030.0TrueBoko Haram
12631BombingLogar, AfghanistanFive Afghan police officers were killed when a...TalibanWar in Afghanistan5.0NaNTrueTaliban
12731ShootingKohistan District, AfghanistanTaliban militants allegedly shot dead six memb...TalibanWar in Afghanistan6.00.0TrueTaliban
12831BombingMaguindanao, PhilippinesA police officer was killed while five others ...Bangsamoro Islamic Freedom FightersMoro conflict1.05.0TrueBangsamoro Islamic Freedom Fighters
12931BombingTacurong, PhilippinesTwo people were killed and 16 others were inju...Bangsamoro Islamic Freedom FightersMoro conflict2.016.0TrueBangsamoro Islamic Freedom Fighters
13031Suicide bombingDeir ez-Zor Governorate, SyriaThe Islamic State terrorist group has carried ...Islamic StateSyrian Civil War20.050.0TrueIslamic State
13131ShootingGiza, EgyptAt least three militants of the Hasm Movement ...Hasm MovementInsurgency in Egypt0.00.0TrueHasm Movement
13231Mortar attackKhmeimim, SyriaTwo Russian soldiers were killed in a mortar a...Islamic State (suspected)Syrian Civil War2.010.0FalseIslamic State
\n", "

1625 rows × 10 columns

\n", "
" ], "text/plain": [ " Date Type Location \\\n", "1 1 Shooting Istanbul, Turkey \n", "2 1 Bombing Herat, Afghanistan \n", "3 1 Shooting Bujumbura, Burundi \n", "4 1 Bombing Quetta, Pakistan \n", "5 1 Assassination Ma'an, Jordan \n", "6 2 Suicide car bombings Baghdad, Iraq \n", "7 2 Suicide car bombing Mogadishu, Somalia \n", "8 2 Suicide bombings Samarra, Iraq \n", "9 3 Assassination Cairo, Egypt \n", "10 3 Shooting Abyan, Yemen \n", "11 3 Shooting Badakhshan, Afghanistan \n", "12 3 Shooting Bria, Central African Republic \n", "13 4 Shooting Quetta, Pakistan \n", "14 4 Car bombing Mogadishu, Somalia \n", "15 4 Jailbreak, shootout Kidapawan, Philippines \n", "16 4 Attempted suicide bombings Madagali, Nigeria \n", "17 4 Shooting Kunduz, Afghanistan \n", "18 4 Shooting Nawa, Afghanistan \n", "19 4 Shooting Bío Bío, Chile \n", "20 5 Suicide car bombing, Car bombing Baghdad, Iraq \n", "21 5 Car bombing Jableh, Syria \n", "22 5 Car bombing, shooting Izmir, Turkey \n", "23 5 Stabbing Ashdod, Israel \n", "24 5 Bombing Gothenburg, Sweden \n", "25 6 Suicide bombings, Car bombing Ad-Dawr, Iraq \n", "26 6 Shooting Quetta, Pakistan \n", "27 6 Stabbing Monufia, Egypt \n", "28 6 Execution Raqqa, Syria \n", "29 6 Shooting Tala wa Barfak, Afghanistan \n", "30 6 Shooting Fort Lauderdale, United States \n", ".. ... ... ... \n", "103 26 Bombing Marada, Libya \n", "104 26 Bombing, Shooting Narathiwat Province, Thailand \n", "105 26 Shootdown Hama Province, Syrian \n", "106 27 Bombing, Shooting Baghdad, Iraq \n", "107 27 Suicide car bombing Lashkargah, Afghanistan \n", "108 27 Bombing St. Petersburg, Russia \n", "109 28 Suicide bombing, Bombings Kabul, Afghanistan \n", "110 28 Bombing Seyhan, Turkey \n", "111 28 Suicide Bombing Borno State, Nigeria \n", "112 28 Bombing, shooting North Sinai Governorate, Egypt \n", "113 29 Shootings Cairo, Egypt \n", "114 29 Shooting Diyala province, Iraq \n", "115 29 Grenade attack Caucasia, Colombia \n", "116 29 Kidnapping Cauca Department, Colombia \n", "117 30 Shooting, arson Borno State, Nigeria \n", "118 30 Car bombing Mazar-i-Sharif, Afghanistan \n", "119 30 Arson Dantewada India \n", "120 30 Shooting Tarragona, Philippinas \n", "121 30 Bombing Ahvaz, Iran \n", "122 31 Bombing Mogadishu, Somalia \n", "123 31 Grenade attack, shooting Pulwama district, India \n", "124 31 Bombing Jalalabad, Afghanistan \n", "125 31 Suicide bombing Far North, Cameroon \n", "126 31 Bombing Logar, Afghanistan \n", "127 31 Shooting Kohistan District, Afghanistan \n", "128 31 Bombing Maguindanao, Philippines \n", "129 31 Bombing Tacurong, Philippines \n", "130 31 Suicide bombing Deir ez-Zor Governorate, Syria \n", "131 31 Shooting Giza, Egypt \n", "132 31 Mortar attack Khmeimim, Syria \n", "\n", " Details \\\n", "1 2017 Istanbul nightclub shooting: One gunman k... \n", "2 At least six people were hurt in an explosion ... \n", "3 The Burundian environmental minister Emmanuel ... \n", "4 Four Frontier Corps security personnel and two... \n", "5 The Islamic State claimed responsibility for a... \n", "6 January 2017 Baghdad bombings: A series of car... \n", "7 January 2017 Mogadishu bombings: A suicide car... \n", "8 Gunmen wearing suicide vests attacked two poli... \n", "9 A Christian businessman was murdered by a Sala... \n", "10 Three Yemeni soldiers were killed and 10 other... \n", "11 A Taliban ambush in the northeastern Badakhsha... \n", "12 Moroccan UN peacekeepers were ambushed by assa... \n", "13 Unknown gunmen killed two government officials... \n", "14 A car bomb attack injured four United Nations ... \n", "15 2017 Kidapawan jail siege: Around 100 gunmen a... \n", "16 Three female suicide bombers were killed while... \n", "17 Two US service members were killed and two oth... \n", "18 A policewoman was shot dead in the Nawa distri... \n", "19 At least five people were injured in an armed ... \n", "20 A car bombing at a food market in the al-Obeid... \n", "21 A car bomb exploded in the coastal city of Jab... \n", "22 2017 İzmir Courthouse Attack: A car bomb explo... \n", "23 A man was stabbed for speaking Arabic.[30] \n", "24 A bomb exploded outside a refugee centre. An i... \n", "25 A police checkpoint near Tikrit was attacked b... \n", "26 Five members of the Hazara Shia community were... \n", "27 Two Egyptian Coptic Christians were murdered. ... \n", "28 Islamic State militants beheaded an elderly ma... \n", "29 Gunmen shot dead at least 13 miners belonging ... \n", "30 shooting attack at Fort Lauderdale Airport [38] \n", ".. ... \n", "103 Militants of the Islamic State attacked one of... \n", "104 At least six thai rangers and a civilian woman... \n", "105 A group of terrorists attacked and shot down a... \n", "106 At one government militiamen was killed and ot... \n", "107 One army soldier and an assailant were killed ... \n", "108 2017 Perekrestok supermarket bombing: At least... \n", "109 December 2017 Kabul suicide bombing: A suicide... \n", "110 An explosion apparently targeted a police stat... \n", "111 A suicide bombing caused by a Boko Haram milit... \n", "112 Two persons, a police officer and a civilian, ... \n", "113 2017 Saint Menas church attack: Eleven people ... \n", "114 A tribal figure was killed in an attack by Isl... \n", "115 43 people were injured when two attackers thre... \n", "116 A 62 years old farmer was kidnapped by members... \n", "117 Boko Haram fighters opened fire on a group of ... \n", "118 At least twelve people were wounded in an expl... \n", "119 At least seven vehicles being used to road con... \n", "120 At least two soldiers were wounded in an ambus... \n", "121 The salafist group Ansar Al-Furqan claimed res... \n", "122 At least two people, including a Somali soldie... \n", "123 Five troopers were killed and three sustained ... \n", "124 An explosion at a funeral in Afghanistan's res... \n", "125 At least two people were killed and 30 more we... \n", "126 Five Afghan police officers were killed when a... \n", "127 Taliban militants allegedly shot dead six memb... \n", "128 A police officer was killed while five others ... \n", "129 Two people were killed and 16 others were inju... \n", "130 The Islamic State terrorist group has carried ... \n", "131 At least three militants of the Hasm Movement ... \n", "132 Two Russian soldiers were killed in a mortar a... \n", "\n", " Perpetrator \\\n", "1 Islamic State \n", "2 Taliban \n", "3 Lone wolf \n", "4 Lashkar-e-Jhangvi (suspected) \n", "5 Islamic State \n", "6 Islamic State \n", "7 Al-Shabaab \n", "8 Islamic State \n", "9 Lone wolf \n", "10 Al-Qaeda in the Arabian Peninsula \n", "11 Taliban \n", "12 Anti-balaka (suspected) \n", "13 Lashkar-e-Jhangvi (suspected) \n", "14 Al-Shabaab \n", "15 Bangsamoro Islamic Freedom Fighters (suspected) \n", "16 Boko Haram \n", "17 Taliban \n", "18 Taliban \n", "19 Mapuche \n", "20 Islamic State (suspected) \n", "21 Islamic State (suspected) \n", "22 Kurdistan Freedom Falcons[29] \n", "23 Lone wolf \n", "24 Nordic Resistance Movement (suspected) \n", "25 Islamic State \n", "26 Lashkar-e-Jhangvi \n", "27 Lone wolf \n", "28 Islamic State \n", "29 Taliban (suspected) \n", "30 Lone wolf \n", ".. ... \n", "103 Islamic State \n", "104 Barisan Revolusi Nasional (suspected) \n", "105 Tahrir al-Sham \n", "106 Islamic State \n", "107 Taliban \n", "108 Islamic State (suspected) \n", "109 Islamic State \n", "110 PKK (suspected) \n", "111 Boko Haram \n", "112 Islamic State (suspected) \n", "113 Islamic State \n", "114 Islamic State \n", "115 FARC dissidents (suspected) \n", "116 FARC Dissidents \n", "117 Boko Haram \n", "118 Taliban (suspected) \n", "119 CPI \n", "120 New People’s Army \n", "121 Ansar Al-Furqan \n", "122 Al-Shabaab \n", "123 Jaish-e-Mohammed \n", "124 Islamic State (suspected) \n", "125 Boko Haram \n", "126 Taliban \n", "127 Taliban \n", "128 Bangsamoro Islamic Freedom Fighters \n", "129 Bangsamoro Islamic Freedom Fighters \n", "130 Islamic State \n", "131 Hasm Movement \n", "132 Islamic State (suspected) \n", "\n", " Part of dead injured confirmed \\\n", "1 Turkey–ISIL conflict 39.0 70.0 True \n", "2 War in Afghanistan 0.0 6.0 True \n", "3 Burundian unrest 1.0 0.0 True \n", "4 Sectarianism in Pakistan 0.0 6.0 False \n", "5 Spillover of the Syrian Civil War 1.0 0.0 True \n", "6 Iraqi Civil War 56.0 122.0 True \n", "7 Somali Civil War 7.0 17.0 True \n", "8 Iraqi Civil War 7.0 NaN True \n", "9 NaN 1.0 0.0 True \n", "10 Al-Qaeda insurgency in Yemen 3.0 10.0 True \n", "11 War in Afghanistan 4.0 0.0 True \n", "12 Central African Republic Civil War 2.0 2.0 False \n", "13 Sectarianism in Pakistan 2.0 0.0 False \n", "14 Somali Civil War 0.0 4.0 True \n", "15 Moro conflict 2.0 1.0 False \n", "16 Boko Haram insurgency 0.0 0.0 True \n", "17 War in Afghanistan 2.0 2.0 True \n", "18 War in Afghanistan 1.0 0.0 True \n", "19 Mapuche conflict 0.0 5.0 True \n", "20 Iraqi Civil War 27.0 57.0 False \n", "21 Syrian Civil War 16.0 30.0 False \n", "22 Kurdish–Turkish conflict 2.0 10.0 True \n", "23 Israeli–Palestinian conflict 0.0 1.0 True \n", "24 Terrorism in Sweden 0.0 1.0 False \n", "25 Iraqi Civil War 4.0 12.0 True \n", "26 Sectarianism in Pakistan 0.0 5.0 True \n", "27 NaN 2.0 0.0 True \n", "28 Syrian Civil War 1.0 0.0 True \n", "29 War in Afghanistan 13.0 3.0 False \n", "30 Terrorism in the United States 5.0 6.0 True \n", ".. ... ... ... ... \n", "103 Libyan Civil War (2014–present) 0.0 0.0 True \n", "104 South Thailand insurgency 0.0 7.0 False \n", "105 Syrian Civil war 1.0 0.0 True \n", "106 Iraqi insurgency 1.0 5.0 True \n", "107 War in Afghanistan 1.0 14.0 True \n", "108 Terrorism in Russia 0.0 18.0 False \n", "109 War in Afghanistan 50.0 80.0 True \n", "110 Kurdish–Turkish conflict 0.0 0.0 False \n", "111 Boko Haram insurgency 6.0 13.0 True \n", "112 Sinai insurgency 8.0 NaN False \n", "113 Terrorism in Egypt 11.0 10.0 True \n", "114 Iraqi insurgency 1.0 0.0 True \n", "115 Colombian conflict 0.0 43.0 False \n", "116 Colombian conflict 0.0 1.0 True \n", "117 Boko Haram insurgency 25.0 NaN True \n", "118 War in Afghanistan 0.0 12.0 False \n", "119 Naxalite-Maoist insurgency 0.0 0.0 True \n", "120 CPP-NPA-NDF rebellion 0.0 2.0 True \n", "121 Arab separatism in Khuzestan 0.0 0.0 True \n", "122 War in Somalia 2.0 NaN True \n", "123 Insurgency in Jammu and Kashmir 5.0 3.0 True \n", "124 War in Afghanistan 18.0 13.0 False \n", "125 Boko Haram insurgency 2.0 30.0 True \n", "126 War in Afghanistan 5.0 NaN True \n", "127 War in Afghanistan 6.0 0.0 True \n", "128 Moro conflict 1.0 5.0 True \n", "129 Moro conflict 2.0 16.0 True \n", "130 Syrian Civil War 20.0 50.0 True \n", "131 Insurgency in Egypt 0.0 0.0 True \n", "132 Syrian Civil War 2.0 10.0 False \n", "\n", " perpetrator_cleaned \n", "1 Islamic State \n", "2 Taliban \n", "3 Lone wolf \n", "4 Lashkar-e-Jhangvi \n", "5 Islamic State \n", "6 Islamic State \n", "7 Al-Shabaab \n", "8 Islamic State \n", "9 Lone wolf \n", "10 Al-Qaeda \n", "11 Taliban \n", "12 Anti-balaka \n", "13 Lashkar-e-Jhangvi \n", "14 Al-Shabaab \n", "15 Bangsamoro Islamic Freedom Fighters \n", "16 Boko Haram \n", "17 Taliban \n", "18 Taliban \n", "19 Mapuche \n", "20 Islamic State \n", "21 Islamic State \n", "22 Kurdistan Freedom Falcons[29] \n", "23 Lone wolf \n", "24 Nordic Resistance Movement \n", "25 Islamic State \n", "26 Lashkar-e-Jhangvi \n", "27 Lone wolf \n", "28 Islamic State \n", "29 Taliban \n", "30 Lone wolf \n", ".. ... \n", "103 Islamic State \n", "104 Barisan Revolusi Nasional \n", "105 Tahrir al-Sham \n", "106 Islamic State \n", "107 Taliban \n", "108 Islamic State \n", "109 Islamic State \n", "110 PKK \n", "111 Boko Haram \n", "112 Islamic State \n", "113 Islamic State \n", "114 Islamic State \n", "115 FARC dissidents \n", "116 FARC Dissidents \n", "117 Boko Haram \n", "118 Taliban \n", "119 CPI \n", "120 New People’s Army \n", "121 Ansar Al-Furqan \n", "122 Al-Shabaab \n", "123 Jaish-e-Mohammed \n", "124 Islamic State \n", "125 Boko Haram \n", "126 Taliban \n", "127 Taliban \n", "128 Bangsamoro Islamic Freedom Fighters \n", "129 Bangsamoro Islamic Freedom Fighters \n", "130 Islamic State \n", "131 Hasm Movement \n", "132 Islamic State \n", "\n", "[1625 rows x 10 columns]" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def _confirmed(x):\n", " if pandas.isnull(x):\n", " return numpy.nan\n", " if x.endswith('(suspected)'):\n", " return False\n", " else:\n", " return True\n", "\n", "perp_mapping = {\n", " 'Islamic State (claimed)': 'Islamic State',\n", " 'Al Shabaab' : 'Al-Shabaab'\n", "}\n", " \n", "def _perp_cleaned(x):\n", " if pandas.isnull(x):\n", " return None\n", " else:\n", " if 'Islamic State' in x:\n", " return 'Islamic State'\n", " if ('Al-Qaeda' in x) or ('Al Qaeda' in x):\n", " return 'Al-Qaeda'\n", " result = x.replace('(suspected)', '').strip()\n", " return perp_mapping.get(result, result)\n", " \n", "data['confirmed'] = data['Perpetrator'].apply(_confirmed)\n", "data['perpetrator_cleaned'] = data['Perpetrator'].apply(_perp_cleaned)\n", "data" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "230\n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
perpetrator_cleaneddeadfraction
82Islamic State3743.00.376749
13Al-Shabaab1221.00.122899
205Taliban1176.00.118369
35Boko Haram815.00.082033
26Anti-balaka288.00.028988
12Al-Qaeda246.00.024761
94Jamaat-ul-Ahrar179.00.018017
204Tahrir al-Sham173.00.017413
221Unknown164.00.016507
69Haqqani network151.00.015199
136Misrata Militants141.00.014192
203Séléka137.00.013790
28Arakan Rohingya Salvation Army105.00.010569
11Al-Mourabitoun77.00.007750
163PKK72.00.007247
212Tehrik-i-Taliban Pakistan65.00.006543
64Fulani herdsmen52.00.005234
138Murle Militias45.00.004529
5Abu Sayyaf44.00.004429
103Kamwina Nsapu43.00.004328
112Lashkar-e-Jhangvi37.00.003724
92Jama'at Nasr al-Islam wal Muslimin37.00.003724
38CPI37.00.003724
48ELN36.00.003624
8Ahrar al-Sham36.00.003624
150New People's Army33.00.003322
30Balochistan Liberation Army27.00.002718
113Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan25.00.002516
118Lone wolf25.00.002516
201Sudan People's Liberation Army24.00.002416
............
18Anarchists1.00.000101
220United Armed Forces of Novorossiya1.00.000101
226West Papua National Liberation Army1.00.000101
178RPA-ABB1.00.000101
227Worker-Peasant Red Guards1.00.000101
55EPP1.00.000101
109La Familia Michoacana1.00.000101
141NSCN1.00.000101
131Mapuche1.00.000101
100Jihadist1.00.000101
116Libya Revolutionaries Operations Room1.00.000101
97Jammu Kashmir Liberation Front1.00.000101
96James Alex Fields1.00.000101
195Shiite militants1.00.000101
95Jamaat-ul-Mujahideen1.00.000101
176Popular Revolutionary Army1.00.000101
198Sohail Khan Ghani1.00.000101
140NDFB-S1.00.000101
78Islamic Army in Iraq1.00.000101
76Individuals Tending to the Wild1.00.000101
125MRT1.00.000101
71Hindu Nationalist1.00.000101
65GNLA1.00.000101
188Salafist jihadist1.00.000101
207Tehreek-i-Taliban1.00.000101
59FARC1.00.000101
61FARC Dissidents or Paramilitaries1.00.000101
190Sanatan Sanstha Militants1.00.000101
56East Indonesia Mujahideen1.00.000101
66Gaitan Self-defenses of Colombia1.00.000101
\n", "

164 rows × 3 columns

\n", "
" ], "text/plain": [ " perpetrator_cleaned dead fraction\n", "82 Islamic State 3743.0 0.376749\n", "13 Al-Shabaab 1221.0 0.122899\n", "205 Taliban 1176.0 0.118369\n", "35 Boko Haram 815.0 0.082033\n", "26 Anti-balaka 288.0 0.028988\n", "12 Al-Qaeda 246.0 0.024761\n", "94 Jamaat-ul-Ahrar 179.0 0.018017\n", "204 Tahrir al-Sham 173.0 0.017413\n", "221 Unknown 164.0 0.016507\n", "69 Haqqani network 151.0 0.015199\n", "136 Misrata Militants 141.0 0.014192\n", "203 Séléka 137.0 0.013790\n", "28 Arakan Rohingya Salvation Army 105.0 0.010569\n", "11 Al-Mourabitoun 77.0 0.007750\n", "163 PKK 72.0 0.007247\n", "212 Tehrik-i-Taliban Pakistan 65.0 0.006543\n", "64 Fulani herdsmen 52.0 0.005234\n", "138 Murle Militias 45.0 0.004529\n", "5 Abu Sayyaf 44.0 0.004429\n", "103 Kamwina Nsapu 43.0 0.004328\n", "112 Lashkar-e-Jhangvi 37.0 0.003724\n", "92 Jama'at Nasr al-Islam wal Muslimin 37.0 0.003724\n", "38 CPI 37.0 0.003724\n", "48 ELN 36.0 0.003624\n", "8 Ahrar al-Sham 36.0 0.003624\n", "150 New People's Army 33.0 0.003322\n", "30 Balochistan Liberation Army 27.0 0.002718\n", "113 Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan 25.0 0.002516\n", "118 Lone wolf 25.0 0.002516\n", "201 Sudan People's Liberation Army 24.0 0.002416\n", ".. ... ... ...\n", "18 Anarchists 1.0 0.000101\n", "220 United Armed Forces of Novorossiya 1.0 0.000101\n", "226 West Papua National Liberation Army 1.0 0.000101\n", "178 RPA-ABB 1.0 0.000101\n", "227 Worker-Peasant Red Guards 1.0 0.000101\n", "55 EPP 1.0 0.000101\n", "109 La Familia Michoacana 1.0 0.000101\n", "141 NSCN 1.0 0.000101\n", "131 Mapuche 1.0 0.000101\n", "100 Jihadist 1.0 0.000101\n", "116 Libya Revolutionaries Operations Room 1.0 0.000101\n", "97 Jammu Kashmir Liberation Front 1.0 0.000101\n", "96 James Alex Fields 1.0 0.000101\n", "195 Shiite militants 1.0 0.000101\n", "95 Jamaat-ul-Mujahideen 1.0 0.000101\n", "176 Popular Revolutionary Army 1.0 0.000101\n", "198 Sohail Khan Ghani 1.0 0.000101\n", "140 NDFB-S 1.0 0.000101\n", "78 Islamic Army in Iraq 1.0 0.000101\n", "76 Individuals Tending to the Wild 1.0 0.000101\n", "125 MRT 1.0 0.000101\n", "71 Hindu Nationalist 1.0 0.000101\n", "65 GNLA 1.0 0.000101\n", "188 Salafist jihadist 1.0 0.000101\n", "207 Tehreek-i-Taliban 1.0 0.000101\n", "59 FARC 1.0 0.000101\n", "61 FARC Dissidents or Paramilitaries 1.0 0.000101\n", "190 Sanatan Sanstha Militants 1.0 0.000101\n", "56 East Indonesia Mujahideen 1.0 0.000101\n", "66 Gaitan Self-defenses of Colombia 1.0 0.000101\n", "\n", "[164 rows x 3 columns]" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count = data.groupby(['perpetrator_cleaned'])['dead'].sum().reset_index().sort_values('dead', ascending=False)\n", "print(len(count))\n", "count['fraction'] = count['dead'] / data['dead'].sum()\n", "count[count['dead'] > 0]" ] }, { "cell_type": "code", "execution_count": 106, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Program Files\\Python_Anaconda3\\lib\\site-packages\\bs4\\__init__.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system (\"lxml\"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.\n", "\n", "The code that caused this warning is on line 193 of the file C:\\Program Files\\Python_Anaconda3\\lib\\runpy.py. To get rid of this warning, change code that looks like this:\n", "\n", " BeautifulSoup([your markup])\n", "\n", "to this:\n", "\n", " BeautifulSoup([your markup], \"lxml\")\n", "\n", " markup_type=markup_type))\n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
perpetrator_cleaneddeadfractionperp_summary
82Islamic State3743.00.376749An Islamic state (Arabic: دولة إسلامية‎, dawla...
13Al-Shabaab1221.00.122899Harakat al-Shabaab al-Mujahideen (HSM; Arabic:...
205Taliban1176.00.118369The Taliban (Pashto: طالبان‎, ṭālibān \"student...
35Boko Haram815.00.082033The Islamic State in West Africa or the Islami...
26Anti-balaka288.00.028988The Anti-balaka is an alliance of militia grou...
12Al-Qaeda246.00.024761Al-Qaeda (; Arabic: القاعدة‎ al-Qāʿidah, IPA: ...
94Jamaat-ul-Ahrar179.00.018017Jamaat-ul-Ahrar (\"Assembly of the Free,\" abbre...
204Tahrir al-Sham173.00.017413Hay'at Tahrir al-Sham (Arabic: هيئة تحرير الشا...
221Unknown164.00.016507None
69Haqqani network151.00.015199The Haqqani network is an Afghan guerrilla ins...
136Misrata Militants141.00.014192None
203Séléka137.00.013790Séléka CPSK-CPJP-UFDR is an alliance of rebel ...
28Arakan Rohingya Salvation Army105.00.010569The Arakan Rohingya Salvation Army (Burmese: အ...
11Al-Mourabitoun77.00.007750The Independent Nasserite Movement – INM (Arab...
163PKK72.00.007247The Kurdistan Workers' Party or PKK (Kurdish: ...
212Tehrik-i-Taliban Pakistan65.00.006543Tehrik-i-Taliban Pakistan (TTP; Urdu: تحریک طا...
64Fulani herdsmen52.00.005234Fulani herdsmen or Fulani pastoralists are nom...
138Murle Militias45.00.004529None
5Abu Sayyaf44.00.004429Abu Sayyaf ( (listen); Arabic: جماعة أبو سياف‎...
103Kamwina Nsapu43.00.004328The Kamwina Nsapu rebellion, also spelled Kamu...
112Lashkar-e-Jhangvi37.00.003724The Lashkar-e-Jhangvi (LeJ; Urdu: لشکر جھنگوی‎...
92Jama'at Nasr al-Islam wal Muslimin37.00.003724Nusrat al-Islam, officially known as Jama'a Nu...
38CPI37.00.003724A Consumer Price Index measures changes in the...
48ELN36.00.003624The National Liberation Army (Spanish: Ejércit...
8Ahrar al-Sham36.00.003624Harakat Ahrar al-Sham al-Islamiyya (Arabic: حر...
150New People's Army33.00.003322The New People's Army (NPA) (Filipino: Bagong ...
30Balochistan Liberation Army27.00.002718The Balochistan Liberation Army (Urdu: بلوچستا...
113Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan25.00.002516None
118Lone wolf25.00.002516None
201Sudan People's Liberation Army24.00.002416The Sudan People's Liberation Army (SPLA) is t...
...............
70Hasm Movement0.00.000000The Arms of Egypt Movement (Arabic: حركة ساعد ...
77Informal Anarchist Federation0.00.000000Informal Anarchist Federation (FAI) (in Italia...
173Popular Front for the Rebirth of Central Afric...0.00.000000Noureddine Adam (born 1970) is the leader of t...
79Islamic Jihad0.00.000000Jihad (English: ; Arabic: جهاد‎ jihād [dʒɪˈha...
172Popular Front for the Liberation of Palestine0.00.000000The Popular Front for the Liberation of Palest...
171Popular Fighters Group0.00.000000The Popular Fighters Group, also referred to a...
170People's Liberation Army, Nepal0.00.000000People's Liberation Army, Nepal (Nepali: जनमुक...
167Paraguayan People's Army0.00.000000The Paraguayan People’s Army (Spanish: Ejércit...
160Organization for Revolutionary Self-Defense0.00.000000The Black Panther Party (BPP), originally the ...
159Opposition militants0.00.000000The English word militant is both an adjective...
154Nordic Resistance Movement0.00.000000The Nordic Resistance Movement, NRM (Swedish: ...
149New Irish Republican Army0.00.000000The Real Irish Republican Army or Real IRA (RI...
145National Liberation Front of Corsica0.00.000000The National Liberation Front of Corsica (Fren...
142NSCN-K0.00.000000None
139NDFB0.00.000000The National Democratic Front of Boroland (NDF...
134Militant Anarchist0.00.000000The English word militant is both an adjective...
133Mariano Fresco, Verónica Altamirano, unknown t...0.00.000000None
132Mapuche Militants0.00.000000This is a list of some of the terrorist, alleg...
128Mai-Mai Militants0.00.000000The Katanga insurgency refers to the ongoing r...
123MCIR0.00.000000None
122Luhansk People's Republic0.00.000000The Luhansk People's Republic (Ukrainian: Луга...
119Lord's Resistance Army0.00.000000The Lord's Resistance Army (LRA), also known a...
110Lashkar al-Zil0.00.000000The Lashkar al-Zil or Shadow Army (also known ...
104Kangleipak Communist Party[42]0.00.000000Manipur ( (listen)) is a state in northeastern...
87Jabhat Fatah al-Sham0.00.000000Al-Nusra Front or Jabhat al-Nusra (Arabic: جبه...
85Ismail Abu Aram0.00.000000None
81Islamic Movement in Israel0.00.000000The Islamic Movement in Israel (also known as ...
229Óglaigh na hÉireann (Real IRA splinter group)0.00.000000Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ...
50ELN and Autodefensas GaitanistasNaNNaNThis is a timeline of terrorist attacks which ...
222Unknown (Hasm Movement suspected)NaNNaNThis is a list of some of the terrorist, alleg...
\n", "

230 rows × 4 columns

\n", "
" ], "text/plain": [ " perpetrator_cleaned dead fraction \\\n", "82 Islamic State 3743.0 0.376749 \n", "13 Al-Shabaab 1221.0 0.122899 \n", "205 Taliban 1176.0 0.118369 \n", "35 Boko Haram 815.0 0.082033 \n", "26 Anti-balaka 288.0 0.028988 \n", "12 Al-Qaeda 246.0 0.024761 \n", "94 Jamaat-ul-Ahrar 179.0 0.018017 \n", "204 Tahrir al-Sham 173.0 0.017413 \n", "221 Unknown 164.0 0.016507 \n", "69 Haqqani network 151.0 0.015199 \n", "136 Misrata Militants 141.0 0.014192 \n", "203 Séléka 137.0 0.013790 \n", "28 Arakan Rohingya Salvation Army 105.0 0.010569 \n", "11 Al-Mourabitoun 77.0 0.007750 \n", "163 PKK 72.0 0.007247 \n", "212 Tehrik-i-Taliban Pakistan 65.0 0.006543 \n", "64 Fulani herdsmen 52.0 0.005234 \n", "138 Murle Militias 45.0 0.004529 \n", "5 Abu Sayyaf 44.0 0.004429 \n", "103 Kamwina Nsapu 43.0 0.004328 \n", "112 Lashkar-e-Jhangvi 37.0 0.003724 \n", "92 Jama'at Nasr al-Islam wal Muslimin 37.0 0.003724 \n", "38 CPI 37.0 0.003724 \n", "48 ELN 36.0 0.003624 \n", "8 Ahrar al-Sham 36.0 0.003624 \n", "150 New People's Army 33.0 0.003322 \n", "30 Balochistan Liberation Army 27.0 0.002718 \n", "113 Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan 25.0 0.002516 \n", "118 Lone wolf 25.0 0.002516 \n", "201 Sudan People's Liberation Army 24.0 0.002416 \n", ".. ... ... ... \n", "70 Hasm Movement 0.0 0.000000 \n", "77 Informal Anarchist Federation 0.0 0.000000 \n", "173 Popular Front for the Rebirth of Central Afric... 0.0 0.000000 \n", "79 Islamic Jihad 0.0 0.000000 \n", "172 Popular Front for the Liberation of Palestine 0.0 0.000000 \n", "171 Popular Fighters Group 0.0 0.000000 \n", "170 People's Liberation Army, Nepal 0.0 0.000000 \n", "167 Paraguayan People's Army 0.0 0.000000 \n", "160 Organization for Revolutionary Self-Defense 0.0 0.000000 \n", "159 Opposition militants 0.0 0.000000 \n", "154 Nordic Resistance Movement 0.0 0.000000 \n", "149 New Irish Republican Army 0.0 0.000000 \n", "145 National Liberation Front of Corsica 0.0 0.000000 \n", "142 NSCN-K 0.0 0.000000 \n", "139 NDFB 0.0 0.000000 \n", "134 Militant Anarchist 0.0 0.000000 \n", "133 Mariano Fresco, Verónica Altamirano, unknown t... 0.0 0.000000 \n", "132 Mapuche Militants 0.0 0.000000 \n", "128 Mai-Mai Militants 0.0 0.000000 \n", "123 MCIR 0.0 0.000000 \n", "122 Luhansk People's Republic 0.0 0.000000 \n", "119 Lord's Resistance Army 0.0 0.000000 \n", "110 Lashkar al-Zil 0.0 0.000000 \n", "104 Kangleipak Communist Party[42] 0.0 0.000000 \n", "87 Jabhat Fatah al-Sham 0.0 0.000000 \n", "85 Ismail Abu Aram 0.0 0.000000 \n", "81 Islamic Movement in Israel 0.0 0.000000 \n", "229 Óglaigh na hÉireann (Real IRA splinter group) 0.0 0.000000 \n", "50 ELN and Autodefensas Gaitanistas NaN NaN \n", "222 Unknown (Hasm Movement suspected) NaN NaN \n", "\n", " perp_summary \n", "82 An Islamic state (Arabic: دولة إسلامية‎, dawla... \n", "13 Harakat al-Shabaab al-Mujahideen (HSM; Arabic:... \n", "205 The Taliban (Pashto: طالبان‎, ṭālibān \"student... \n", "35 The Islamic State in West Africa or the Islami... \n", "26 The Anti-balaka is an alliance of militia grou... \n", "12 Al-Qaeda (; Arabic: القاعدة‎ al-Qāʿidah, IPA: ... \n", "94 Jamaat-ul-Ahrar (\"Assembly of the Free,\" abbre... \n", "204 Hay'at Tahrir al-Sham (Arabic: هيئة تحرير الشا... \n", "221 None \n", "69 The Haqqani network is an Afghan guerrilla ins... \n", "136 None \n", "203 Séléka CPSK-CPJP-UFDR is an alliance of rebel ... \n", "28 The Arakan Rohingya Salvation Army (Burmese: အ... \n", "11 The Independent Nasserite Movement – INM (Arab... \n", "163 The Kurdistan Workers' Party or PKK (Kurdish: ... \n", "212 Tehrik-i-Taliban Pakistan (TTP; Urdu: تحریک طا... \n", "64 Fulani herdsmen or Fulani pastoralists are nom... \n", "138 None \n", "5 Abu Sayyaf ( (listen); Arabic: جماعة أبو سياف‎... \n", "103 The Kamwina Nsapu rebellion, also spelled Kamu... \n", "112 The Lashkar-e-Jhangvi (LeJ; Urdu: لشکر جھنگوی‎... \n", "92 Nusrat al-Islam, officially known as Jama'a Nu... \n", "38 A Consumer Price Index measures changes in the... \n", "48 The National Liberation Army (Spanish: Ejércit... \n", "8 Harakat Ahrar al-Sham al-Islamiyya (Arabic: حر... \n", "150 The New People's Army (NPA) (Filipino: Bagong ... \n", "30 The Balochistan Liberation Army (Urdu: بلوچستا... \n", "113 None \n", "118 None \n", "201 The Sudan People's Liberation Army (SPLA) is t... \n", ".. ... \n", "70 The Arms of Egypt Movement (Arabic: حركة ساعد ... \n", "77 Informal Anarchist Federation (FAI) (in Italia... \n", "173 Noureddine Adam (born 1970) is the leader of t... \n", "79 Jihad (English: ; Arabic: جهاد‎ jihād [dʒɪˈha... \n", "172 The Popular Front for the Liberation of Palest... \n", "171 The Popular Fighters Group, also referred to a... \n", "170 People's Liberation Army, Nepal (Nepali: जनमुक... \n", "167 The Paraguayan People’s Army (Spanish: Ejércit... \n", "160 The Black Panther Party (BPP), originally the ... \n", "159 The English word militant is both an adjective... \n", "154 The Nordic Resistance Movement, NRM (Swedish: ... \n", "149 The Real Irish Republican Army or Real IRA (RI... \n", "145 The National Liberation Front of Corsica (Fren... \n", "142 None \n", "139 The National Democratic Front of Boroland (NDF... \n", "134 The English word militant is both an adjective... \n", "133 None \n", "132 This is a list of some of the terrorist, alleg... \n", "128 The Katanga insurgency refers to the ongoing r... \n", "123 None \n", "122 The Luhansk People's Republic (Ukrainian: Луга... \n", "119 The Lord's Resistance Army (LRA), also known a... \n", "110 The Lashkar al-Zil or Shadow Army (also known ... \n", "104 Manipur ( (listen)) is a state in northeastern... \n", "87 Al-Nusra Front or Jabhat al-Nusra (Arabic: جبه... \n", "85 None \n", "81 The Islamic Movement in Israel (also known as ... \n", "229 Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ... \n", "50 This is a timeline of terrorist attacks which ... \n", "222 This is a list of some of the terrorist, alleg... \n", "\n", "[230 rows x 4 columns]" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import wikipedia\n", "\n", "def get_summary(x):\n", " if x == 'Unknown':\n", " return None\n", " try:\n", " return wikipedia.page(x).summary\n", " except Exception:\n", " return None\n", "\n", "count['perp_summary'] = count['perpetrator_cleaned'].apply(get_summary)\n", "count" ] }, { "cell_type": "code", "execution_count": 107, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "121\n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
perpetrator_cleaneddeadfractionperp_summarycause
221Unknown164.00.016507NoneNone
136Misrata Militants141.00.014192NoneNone
64Fulani herdsmen52.00.005234Fulani herdsmen or Fulani pastoralists are nom...None
138Murle Militias45.00.004529NoneNone
30Balochistan Liberation Army27.00.002718The Balochistan Liberation Army (Urdu: بلوچستا...None
113Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan25.00.002516NoneNone
118Lone wolf25.00.002516NoneNone
201Sudan People's Liberation Army24.00.002416The Sudan People's Liberation Army (SPLA) is t...None
189Salman Abedi22.00.002214The Manchester Arena bombing was a suicide bom...None
153Ninja18.00.001812A ninja (忍者) or shinobi (忍び) was a covert agen...None
74Imam Shamil Battalion16.00.001610The Imam Shamil Battalion, also known as Katib...None
31Balochistan Liberation Front15.00.001510The Balochistan Liberation Front (Urdu: بلوچست...None
213The Hasm Movement14.00.001409The Arms of Egypt Movement (Arabic: حركة ساعد ...None
1AQIM14.00.001409NoneNone
135Militants12.00.001208The English word militant is both an adjective...None
194Shia militants11.00.001107NoneNone
63FNL11.00.001107NoneNone
33Barisan Revolusi Nasional10.00.001007The Barisan Revolusi Nasional Melayu Patani, a...None
162PJAK10.00.001007The Kurdistan Free Life Party, or PJAK (Kurdis...None
24Ansar ul Islam9.00.000906Ansar ul Islam is a militant Islamist group ac...None
62FARC dissidents8.00.000805FARC dissidents refers to a group, formerly pa...None
91Jaish-e-Muhammad (claimed)8.00.000805NoneNone
47Donetsk People's Republic8.00.000805The Donetsk People's Republic (DPR or DNR, Rus...None
117Lone Wolf7.00.000705NoneNone
45Democratic Union Party7.00.000705The Democratic Union Party or PYD (Kurdish: Pa...None
126MS-137.00.000705Mara Salvatrucha, popularly known as MS-13, is...None
121Los Zetas7.00.000705Los Zetas (pronounced [los ˈsetas], Spanish fo...None
60FARC Dissidents6.00.000604FARC dissidents refers to a group, formerly pa...None
168Paramilitaries6.00.000604A paramilitary is a semi-militarized force who...None
164PLA5.00.000503NoneNone
..................
43Coordinadora Arauco-Malleco0.00.000000Coordinadora Arauco-Malleco (CAM) is a Mapuche...None
42Coordinadora Arauco Malleco0.00.000000Coordinadora Arauco-Malleco (CAM) is a Mapuche...None
39Colectivos0.00.000000Colectivos or collectives are irregular, lefti...None
27Anti-government militants0.00.0000001983 Dhilwan Bus massacre was a massacre of 6 ...None
25Anti-Maduro militants0.00.000000NoneNone
20Ansar Al-Furqan0.00.000000Ansar Al-Furqan (Arabic: انصار الفرقان‎, Parti...None
14Albanian Kosovars Militants0.00.000000NoneNone
10Al-Aqsa Martyrs' Brigades0.00.000000The al-Aqsa Martyrs' Brigades (Arabic: كتائب ش...None
9Akayed Ullah0.00.000000On December 11, 2017, a pipe bomb partially de...None
6Ahmed Amin El-Mofty0.00.000000NoneNone
3Abu Ali Mustapha Brigades0.00.000000The Abu Ali Mustapha Brigades (Arabic: كتائب ا...None
70Hasm Movement0.00.000000The Arms of Egypt Movement (Arabic: حركة ساعد ...None
171Popular Fighters Group0.00.000000The Popular Fighters Group, also referred to a...None
167Paraguayan People's Army0.00.000000The Paraguayan People’s Army (Spanish: Ejércit...None
160Organization for Revolutionary Self-Defense0.00.000000The Black Panther Party (BPP), originally the ...None
159Opposition militants0.00.000000The English word militant is both an adjective...None
154Nordic Resistance Movement0.00.000000The Nordic Resistance Movement, NRM (Swedish: ...None
149New Irish Republican Army0.00.000000The Real Irish Republican Army or Real IRA (RI...None
145National Liberation Front of Corsica0.00.000000The National Liberation Front of Corsica (Fren...None
142NSCN-K0.00.000000NoneNone
139NDFB0.00.000000The National Democratic Front of Boroland (NDF...None
134Militant Anarchist0.00.000000The English word militant is both an adjective...None
133Mariano Fresco, Verónica Altamirano, unknown t...0.00.000000NoneNone
132Mapuche Militants0.00.000000This is a list of some of the terrorist, alleg...None
123MCIR0.00.000000NoneNone
122Luhansk People's Republic0.00.000000The Luhansk People's Republic (Ukrainian: Луга...None
85Ismail Abu Aram0.00.000000NoneNone
229Óglaigh na hÉireann (Real IRA splinter group)0.00.000000Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ...None
50ELN and Autodefensas GaitanistasNaNNaNThis is a timeline of terrorist attacks which ...None
222Unknown (Hasm Movement suspected)NaNNaNThis is a list of some of the terrorist, alleg...None
\n", "

121 rows × 5 columns

\n", "
" ], "text/plain": [ " perpetrator_cleaned dead fraction \\\n", "221 Unknown 164.0 0.016507 \n", "136 Misrata Militants 141.0 0.014192 \n", "64 Fulani herdsmen 52.0 0.005234 \n", "138 Murle Militias 45.0 0.004529 \n", "30 Balochistan Liberation Army 27.0 0.002718 \n", "113 Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan 25.0 0.002516 \n", "118 Lone wolf 25.0 0.002516 \n", "201 Sudan People's Liberation Army 24.0 0.002416 \n", "189 Salman Abedi 22.0 0.002214 \n", "153 Ninja 18.0 0.001812 \n", "74 Imam Shamil Battalion 16.0 0.001610 \n", "31 Balochistan Liberation Front 15.0 0.001510 \n", "213 The Hasm Movement 14.0 0.001409 \n", "1 AQIM 14.0 0.001409 \n", "135 Militants 12.0 0.001208 \n", "194 Shia militants 11.0 0.001107 \n", "63 FNL 11.0 0.001107 \n", "33 Barisan Revolusi Nasional 10.0 0.001007 \n", "162 PJAK 10.0 0.001007 \n", "24 Ansar ul Islam 9.0 0.000906 \n", "62 FARC dissidents 8.0 0.000805 \n", "91 Jaish-e-Muhammad (claimed) 8.0 0.000805 \n", "47 Donetsk People's Republic 8.0 0.000805 \n", "117 Lone Wolf 7.0 0.000705 \n", "45 Democratic Union Party 7.0 0.000705 \n", "126 MS-13 7.0 0.000705 \n", "121 Los Zetas 7.0 0.000705 \n", "60 FARC Dissidents 6.0 0.000604 \n", "168 Paramilitaries 6.0 0.000604 \n", "164 PLA 5.0 0.000503 \n", ".. ... ... ... \n", "43 Coordinadora Arauco-Malleco 0.0 0.000000 \n", "42 Coordinadora Arauco Malleco 0.0 0.000000 \n", "39 Colectivos 0.0 0.000000 \n", "27 Anti-government militants 0.0 0.000000 \n", "25 Anti-Maduro militants 0.0 0.000000 \n", "20 Ansar Al-Furqan 0.0 0.000000 \n", "14 Albanian Kosovars Militants 0.0 0.000000 \n", "10 Al-Aqsa Martyrs' Brigades 0.0 0.000000 \n", "9 Akayed Ullah 0.0 0.000000 \n", "6 Ahmed Amin El-Mofty 0.0 0.000000 \n", "3 Abu Ali Mustapha Brigades 0.0 0.000000 \n", "70 Hasm Movement 0.0 0.000000 \n", "171 Popular Fighters Group 0.0 0.000000 \n", "167 Paraguayan People's Army 0.0 0.000000 \n", "160 Organization for Revolutionary Self-Defense 0.0 0.000000 \n", "159 Opposition militants 0.0 0.000000 \n", "154 Nordic Resistance Movement 0.0 0.000000 \n", "149 New Irish Republican Army 0.0 0.000000 \n", "145 National Liberation Front of Corsica 0.0 0.000000 \n", "142 NSCN-K 0.0 0.000000 \n", "139 NDFB 0.0 0.000000 \n", "134 Militant Anarchist 0.0 0.000000 \n", "133 Mariano Fresco, Verónica Altamirano, unknown t... 0.0 0.000000 \n", "132 Mapuche Militants 0.0 0.000000 \n", "123 MCIR 0.0 0.000000 \n", "122 Luhansk People's Republic 0.0 0.000000 \n", "85 Ismail Abu Aram 0.0 0.000000 \n", "229 Óglaigh na hÉireann (Real IRA splinter group) 0.0 0.000000 \n", "50 ELN and Autodefensas Gaitanistas NaN NaN \n", "222 Unknown (Hasm Movement suspected) NaN NaN \n", "\n", " perp_summary cause \n", "221 None None \n", "136 None None \n", "64 Fulani herdsmen or Fulani pastoralists are nom... None \n", "138 None None \n", "30 The Balochistan Liberation Army (Urdu: بلوچستا... None \n", "113 None None \n", "118 None None \n", "201 The Sudan People's Liberation Army (SPLA) is t... None \n", "189 The Manchester Arena bombing was a suicide bom... None \n", "153 A ninja (忍者) or shinobi (忍び) was a covert agen... None \n", "74 The Imam Shamil Battalion, also known as Katib... None \n", "31 The Balochistan Liberation Front (Urdu: بلوچست... None \n", "213 The Arms of Egypt Movement (Arabic: حركة ساعد ... None \n", "1 None None \n", "135 The English word militant is both an adjective... None \n", "194 None None \n", "63 None None \n", "33 The Barisan Revolusi Nasional Melayu Patani, a... None \n", "162 The Kurdistan Free Life Party, or PJAK (Kurdis... None \n", "24 Ansar ul Islam is a militant Islamist group ac... None \n", "62 FARC dissidents refers to a group, formerly pa... None \n", "91 None None \n", "47 The Donetsk People's Republic (DPR or DNR, Rus... None \n", "117 None None \n", "45 The Democratic Union Party or PYD (Kurdish: Pa... None \n", "126 Mara Salvatrucha, popularly known as MS-13, is... None \n", "121 Los Zetas (pronounced [los ˈsetas], Spanish fo... None \n", "60 FARC dissidents refers to a group, formerly pa... None \n", "168 A paramilitary is a semi-militarized force who... None \n", "164 None None \n", ".. ... ... \n", "43 Coordinadora Arauco-Malleco (CAM) is a Mapuche... None \n", "42 Coordinadora Arauco-Malleco (CAM) is a Mapuche... None \n", "39 Colectivos or collectives are irregular, lefti... None \n", "27 1983 Dhilwan Bus massacre was a massacre of 6 ... None \n", "25 None None \n", "20 Ansar Al-Furqan (Arabic: انصار الفرقان‎, Parti... None \n", "14 None None \n", "10 The al-Aqsa Martyrs' Brigades (Arabic: كتائب ش... None \n", "9 On December 11, 2017, a pipe bomb partially de... None \n", "6 None None \n", "3 The Abu Ali Mustapha Brigades (Arabic: كتائب ا... None \n", "70 The Arms of Egypt Movement (Arabic: حركة ساعد ... None \n", "171 The Popular Fighters Group, also referred to a... None \n", "167 The Paraguayan People’s Army (Spanish: Ejércit... None \n", "160 The Black Panther Party (BPP), originally the ... None \n", "159 The English word militant is both an adjective... None \n", "154 The Nordic Resistance Movement, NRM (Swedish: ... None \n", "149 The Real Irish Republican Army or Real IRA (RI... None \n", "145 The National Liberation Front of Corsica (Fren... None \n", "142 None None \n", "139 The National Democratic Front of Boroland (NDF... None \n", "134 The English word militant is both an adjective... None \n", "133 None None \n", "132 This is a list of some of the terrorist, alleg... None \n", "123 None None \n", "122 The Luhansk People's Republic (Ukrainian: Луга... None \n", "85 None None \n", "229 Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ... None \n", "50 This is a timeline of terrorist attacks which ... None \n", "222 This is a list of some of the terrorist, alleg... None \n", "\n", "[121 rows x 5 columns]" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def extract_cause(x):\n", " if x is None:\n", " return None\n", " if 'Islamic' in x:\n", " return 'Islam'\n", " if 'Taliban' in x:\n", " return 'Islam'\n", " if 'jihadi' in x.lower():\n", " return 'Islam'\n", " if 'Communist' in x:\n", " return 'Communism'\n", " if 'Central African Republic' in x:\n", " return 'Central Africal Republic'\n", " if 'Congo' in x:\n", " return 'Congo'\n", " if ('far-right' in x.lower()) or ('far right' in x.lower()):\n", " return 'Far-right'\n", " if ('far-left' in x.lower()) or ('far left' in x.lower()):\n", " return 'Far-left'\n", " if 'anarchist' in x.lower():\n", " return 'Anarchy'\n", " if 'myanmar' in x.lower():\n", " return \"Myanmar\"\n", " if \"Nasserite\" in x:\n", " return 'Communism'\n", " if ('Marxist' in x) or ('Marxism' in x):\n", " return 'Communism'\n", " if 'Consumer Price Index' in x: # CPI is abbreviation for Communist Party of India, wikipedia gives Consumer Price Index\n", " return 'Communism'\n", " return None\n", "\n", "count['cause'] = count['perp_summary'].apply(extract_cause)\n", "print(pandas.isnull(count['cause']).sum())\n", "count[pandas.isnull(count['cause'])]" ] }, { "cell_type": "code", "execution_count": 108, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "9109.0\n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
causedead
6Islam8170.0
1Central Africal Republic432.0
2Communism310.0
7Myanmar105.0
3Congo85.0
0Anarchy3.0
5Far-right3.0
4Far-left1.0
\n", "
" ], "text/plain": [ " cause dead\n", "6 Islam 8170.0\n", "1 Central Africal Republic 432.0\n", "2 Communism 310.0\n", "7 Myanmar 105.0\n", "3 Congo 85.0\n", "0 Anarchy 3.0\n", "5 Far-right 3.0\n", "4 Far-left 1.0" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "by_cause = count.groupby(['cause'])['dead'].sum().reset_index().sort_values('dead', ascending=False)\n", "print(by_cause['dead'].sum())\n", "by_cause" ] }, { "cell_type": "code", "execution_count": 109, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.9170441961139636" ] }, "execution_count": 109, "metadata": {}, "output_type": "execute_result" } ], "source": [ "by_cause['dead'].sum() / count['dead'].sum()" ] }, { "cell_type": "code", "execution_count": 113, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.031209100976542836" ] }, "execution_count": 113, "metadata": {}, "output_type": "execute_result" } ], "source": [ "310 / count['dead'].sum()" ] }, { "cell_type": "code", "execution_count": 116, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
perpetrator_cleaneddeadfractionperp_summarycausedead_totalcum_frac
82Islamic State3743.00.376749An Islamic state (Arabic: دولة إسلامية‎, dawla...Islam3743.00.376825
13Al-Shabaab1221.00.122899Harakat al-Shabaab al-Mujahideen (HSM; Arabic:...Islam4964.00.499748
205Taliban1176.00.118369The Taliban (Pashto: طالبان‎, ṭālibān \"student...Islam6140.00.618142
35Boko Haram815.00.082033The Islamic State in West Africa or the Islami...Islam6955.00.700191
26Anti-balaka288.00.028988The Anti-balaka is an alliance of militia grou...Central Africal Republic7243.00.729186
12Al-Qaeda246.00.024761Al-Qaeda (; Arabic: القاعدة‎ al-Qāʿidah, IPA: ...Islam7489.00.753951
94Jamaat-ul-Ahrar179.00.018017Jamaat-ul-Ahrar (\"Assembly of the Free,\" abbre...Islam7668.00.771972
204Tahrir al-Sham173.00.017413Hay'at Tahrir al-Sham (Arabic: هيئة تحرير الشا...Islam7841.00.789389
221Unknown164.00.016507NoneNone8005.00.805900
69Haqqani network151.00.015199The Haqqani network is an Afghan guerrilla ins...Islam8156.00.821101
136Misrata Militants141.00.014192NoneNone8297.00.835296
203Séléka137.00.013790Séléka CPSK-CPJP-UFDR is an alliance of rebel ...Central Africal Republic8434.00.849089
28Arakan Rohingya Salvation Army105.00.010569The Arakan Rohingya Salvation Army (Burmese: အ...Myanmar8539.00.859660
11Al-Mourabitoun77.00.007750The Independent Nasserite Movement – INM (Arab...Communism8616.00.867412
163PKK72.00.007247The Kurdistan Workers' Party or PKK (Kurdish: ...Communism8688.00.874660
212Tehrik-i-Taliban Pakistan65.00.006543Tehrik-i-Taliban Pakistan (TTP; Urdu: تحریک طا...Islam8753.00.881204
64Fulani herdsmen52.00.005234Fulani herdsmen or Fulani pastoralists are nom...None8805.00.886439
138Murle Militias45.00.004529NoneNone8850.00.890969
5Abu Sayyaf44.00.004429Abu Sayyaf ( (listen); Arabic: جماعة أبو سياف‎...Islam8894.00.895399
103Kamwina Nsapu43.00.004328The Kamwina Nsapu rebellion, also spelled Kamu...Congo8937.00.899728
112Lashkar-e-Jhangvi37.00.003724The Lashkar-e-Jhangvi (LeJ; Urdu: لشکر جھنگوی‎...Islam8974.00.903453
92Jama'at Nasr al-Islam wal Muslimin37.00.003724Nusrat al-Islam, officially known as Jama'a Nu...Islam9011.00.907178
38CPI37.00.003724A Consumer Price Index measures changes in the...Communism9048.00.910903
48ELN36.00.003624The National Liberation Army (Spanish: Ejércit...Communism9084.00.914527
8Ahrar al-Sham36.00.003624Harakat Ahrar al-Sham al-Islamiyya (Arabic: حر...Islam9120.00.918152
150New People's Army33.00.003322The New People's Army (NPA) (Filipino: Bagong ...Communism9153.00.921474
30Balochistan Liberation Army27.00.002718The Balochistan Liberation Army (Urdu: بلوچستا...None9180.00.924192
113Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan25.00.002516NoneNone9205.00.926709
118Lone wolf25.00.002516NoneNone9230.00.929226
201Sudan People's Liberation Army24.00.002416The Sudan People's Liberation Army (SPLA) is t...None9254.00.931642
........................
70Hasm Movement0.00.000000The Arms of Egypt Movement (Arabic: حركة ساعد ...None9933.01.000000
77Informal Anarchist Federation0.00.000000Informal Anarchist Federation (FAI) (in Italia...Anarchy9933.01.000000
173Popular Front for the Rebirth of Central Afric...0.00.000000Noureddine Adam (born 1970) is the leader of t...Central Africal Republic9933.01.000000
79Islamic Jihad0.00.000000Jihad (English: ; Arabic: جهاد‎ jihād [dʒɪˈha...Islam9933.01.000000
172Popular Front for the Liberation of Palestine0.00.000000The Popular Front for the Liberation of Palest...Islam9933.01.000000
171Popular Fighters Group0.00.000000The Popular Fighters Group, also referred to a...None9933.01.000000
170People's Liberation Army, Nepal0.00.000000People's Liberation Army, Nepal (Nepali: जनमुक...Communism9933.01.000000
167Paraguayan People's Army0.00.000000The Paraguayan People’s Army (Spanish: Ejércit...None9933.01.000000
160Organization for Revolutionary Self-Defense0.00.000000The Black Panther Party (BPP), originally the ...None9933.01.000000
159Opposition militants0.00.000000The English word militant is both an adjective...None9933.01.000000
154Nordic Resistance Movement0.00.000000The Nordic Resistance Movement, NRM (Swedish: ...None9933.01.000000
149New Irish Republican Army0.00.000000The Real Irish Republican Army or Real IRA (RI...None9933.01.000000
145National Liberation Front of Corsica0.00.000000The National Liberation Front of Corsica (Fren...None9933.01.000000
142NSCN-K0.00.000000NoneNone9933.01.000000
139NDFB0.00.000000The National Democratic Front of Boroland (NDF...None9933.01.000000
134Militant Anarchist0.00.000000The English word militant is both an adjective...None9933.01.000000
133Mariano Fresco, Verónica Altamirano, unknown t...0.00.000000NoneNone9933.01.000000
132Mapuche Militants0.00.000000This is a list of some of the terrorist, alleg...None9933.01.000000
128Mai-Mai Militants0.00.000000The Katanga insurgency refers to the ongoing r...Congo9933.01.000000
123MCIR0.00.000000NoneNone9933.01.000000
122Luhansk People's Republic0.00.000000The Luhansk People's Republic (Ukrainian: Луга...None9933.01.000000
119Lord's Resistance Army0.00.000000The Lord's Resistance Army (LRA), also known a...Central Africal Republic9933.01.000000
110Lashkar al-Zil0.00.000000The Lashkar al-Zil or Shadow Army (also known ...Islam9933.01.000000
104Kangleipak Communist Party[42]0.00.000000Manipur ( (listen)) is a state in northeastern...Myanmar9933.01.000000
87Jabhat Fatah al-Sham0.00.000000Al-Nusra Front or Jabhat al-Nusra (Arabic: جبه...Islam9933.01.000000
85Ismail Abu Aram0.00.000000NoneNone9933.01.000000
81Islamic Movement in Israel0.00.000000The Islamic Movement in Israel (also known as ...Islam9933.01.000000
229Óglaigh na hÉireann (Real IRA splinter group)0.00.000000Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ...None9933.01.000000
50ELN and Autodefensas GaitanistasNaNNaNThis is a timeline of terrorist attacks which ...NoneNaNNaN
222Unknown (Hasm Movement suspected)NaNNaNThis is a list of some of the terrorist, alleg...NoneNaNNaN
\n", "

230 rows × 7 columns

\n", "
" ], "text/plain": [ " perpetrator_cleaned dead fraction \\\n", "82 Islamic State 3743.0 0.376749 \n", "13 Al-Shabaab 1221.0 0.122899 \n", "205 Taliban 1176.0 0.118369 \n", "35 Boko Haram 815.0 0.082033 \n", "26 Anti-balaka 288.0 0.028988 \n", "12 Al-Qaeda 246.0 0.024761 \n", "94 Jamaat-ul-Ahrar 179.0 0.018017 \n", "204 Tahrir al-Sham 173.0 0.017413 \n", "221 Unknown 164.0 0.016507 \n", "69 Haqqani network 151.0 0.015199 \n", "136 Misrata Militants 141.0 0.014192 \n", "203 Séléka 137.0 0.013790 \n", "28 Arakan Rohingya Salvation Army 105.0 0.010569 \n", "11 Al-Mourabitoun 77.0 0.007750 \n", "163 PKK 72.0 0.007247 \n", "212 Tehrik-i-Taliban Pakistan 65.0 0.006543 \n", "64 Fulani herdsmen 52.0 0.005234 \n", "138 Murle Militias 45.0 0.004529 \n", "5 Abu Sayyaf 44.0 0.004429 \n", "103 Kamwina Nsapu 43.0 0.004328 \n", "112 Lashkar-e-Jhangvi 37.0 0.003724 \n", "92 Jama'at Nasr al-Islam wal Muslimin 37.0 0.003724 \n", "38 CPI 37.0 0.003724 \n", "48 ELN 36.0 0.003624 \n", "8 Ahrar al-Sham 36.0 0.003624 \n", "150 New People's Army 33.0 0.003322 \n", "30 Balochistan Liberation Army 27.0 0.002718 \n", "113 Lashkar-e-Jhangvi & Tehrik-i-Taliban Pakistan 25.0 0.002516 \n", "118 Lone wolf 25.0 0.002516 \n", "201 Sudan People's Liberation Army 24.0 0.002416 \n", ".. ... ... ... \n", "70 Hasm Movement 0.0 0.000000 \n", "77 Informal Anarchist Federation 0.0 0.000000 \n", "173 Popular Front for the Rebirth of Central Afric... 0.0 0.000000 \n", "79 Islamic Jihad 0.0 0.000000 \n", "172 Popular Front for the Liberation of Palestine 0.0 0.000000 \n", "171 Popular Fighters Group 0.0 0.000000 \n", "170 People's Liberation Army, Nepal 0.0 0.000000 \n", "167 Paraguayan People's Army 0.0 0.000000 \n", "160 Organization for Revolutionary Self-Defense 0.0 0.000000 \n", "159 Opposition militants 0.0 0.000000 \n", "154 Nordic Resistance Movement 0.0 0.000000 \n", "149 New Irish Republican Army 0.0 0.000000 \n", "145 National Liberation Front of Corsica 0.0 0.000000 \n", "142 NSCN-K 0.0 0.000000 \n", "139 NDFB 0.0 0.000000 \n", "134 Militant Anarchist 0.0 0.000000 \n", "133 Mariano Fresco, Verónica Altamirano, unknown t... 0.0 0.000000 \n", "132 Mapuche Militants 0.0 0.000000 \n", "128 Mai-Mai Militants 0.0 0.000000 \n", "123 MCIR 0.0 0.000000 \n", "122 Luhansk People's Republic 0.0 0.000000 \n", "119 Lord's Resistance Army 0.0 0.000000 \n", "110 Lashkar al-Zil 0.0 0.000000 \n", "104 Kangleipak Communist Party[42] 0.0 0.000000 \n", "87 Jabhat Fatah al-Sham 0.0 0.000000 \n", "85 Ismail Abu Aram 0.0 0.000000 \n", "81 Islamic Movement in Israel 0.0 0.000000 \n", "229 Óglaigh na hÉireann (Real IRA splinter group) 0.0 0.000000 \n", "50 ELN and Autodefensas Gaitanistas NaN NaN \n", "222 Unknown (Hasm Movement suspected) NaN NaN \n", "\n", " perp_summary \\\n", "82 An Islamic state (Arabic: دولة إسلامية‎, dawla... \n", "13 Harakat al-Shabaab al-Mujahideen (HSM; Arabic:... \n", "205 The Taliban (Pashto: طالبان‎, ṭālibān \"student... \n", "35 The Islamic State in West Africa or the Islami... \n", "26 The Anti-balaka is an alliance of militia grou... \n", "12 Al-Qaeda (; Arabic: القاعدة‎ al-Qāʿidah, IPA: ... \n", "94 Jamaat-ul-Ahrar (\"Assembly of the Free,\" abbre... \n", "204 Hay'at Tahrir al-Sham (Arabic: هيئة تحرير الشا... \n", "221 None \n", "69 The Haqqani network is an Afghan guerrilla ins... \n", "136 None \n", "203 Séléka CPSK-CPJP-UFDR is an alliance of rebel ... \n", "28 The Arakan Rohingya Salvation Army (Burmese: အ... \n", "11 The Independent Nasserite Movement – INM (Arab... \n", "163 The Kurdistan Workers' Party or PKK (Kurdish: ... \n", "212 Tehrik-i-Taliban Pakistan (TTP; Urdu: تحریک طا... \n", "64 Fulani herdsmen or Fulani pastoralists are nom... \n", "138 None \n", "5 Abu Sayyaf ( (listen); Arabic: جماعة أبو سياف‎... \n", "103 The Kamwina Nsapu rebellion, also spelled Kamu... \n", "112 The Lashkar-e-Jhangvi (LeJ; Urdu: لشکر جھنگوی‎... \n", "92 Nusrat al-Islam, officially known as Jama'a Nu... \n", "38 A Consumer Price Index measures changes in the... \n", "48 The National Liberation Army (Spanish: Ejércit... \n", "8 Harakat Ahrar al-Sham al-Islamiyya (Arabic: حر... \n", "150 The New People's Army (NPA) (Filipino: Bagong ... \n", "30 The Balochistan Liberation Army (Urdu: بلوچستا... \n", "113 None \n", "118 None \n", "201 The Sudan People's Liberation Army (SPLA) is t... \n", ".. ... \n", "70 The Arms of Egypt Movement (Arabic: حركة ساعد ... \n", "77 Informal Anarchist Federation (FAI) (in Italia... \n", "173 Noureddine Adam (born 1970) is the leader of t... \n", "79 Jihad (English: ; Arabic: جهاد‎ jihād [dʒɪˈha... \n", "172 The Popular Front for the Liberation of Palest... \n", "171 The Popular Fighters Group, also referred to a... \n", "170 People's Liberation Army, Nepal (Nepali: जनमुक... \n", "167 The Paraguayan People’s Army (Spanish: Ejércit... \n", "160 The Black Panther Party (BPP), originally the ... \n", "159 The English word militant is both an adjective... \n", "154 The Nordic Resistance Movement, NRM (Swedish: ... \n", "149 The Real Irish Republican Army or Real IRA (RI... \n", "145 The National Liberation Front of Corsica (Fren... \n", "142 None \n", "139 The National Democratic Front of Boroland (NDF... \n", "134 The English word militant is both an adjective... \n", "133 None \n", "132 This is a list of some of the terrorist, alleg... \n", "128 The Katanga insurgency refers to the ongoing r... \n", "123 None \n", "122 The Luhansk People's Republic (Ukrainian: Луга... \n", "119 The Lord's Resistance Army (LRA), also known a... \n", "110 The Lashkar al-Zil or Shadow Army (also known ... \n", "104 Manipur ( (listen)) is a state in northeastern... \n", "87 Al-Nusra Front or Jabhat al-Nusra (Arabic: جبه... \n", "85 None \n", "81 The Islamic Movement in Israel (also known as ... \n", "229 Óglaigh na hÉireann (ONH; [ˈoːɡɫ̪iː n̪ˠə ˈheːɾ... \n", "50 This is a timeline of terrorist attacks which ... \n", "222 This is a list of some of the terrorist, alleg... \n", "\n", " cause dead_total cum_frac \n", "82 Islam 3743.0 0.376825 \n", "13 Islam 4964.0 0.499748 \n", "205 Islam 6140.0 0.618142 \n", "35 Islam 6955.0 0.700191 \n", "26 Central Africal Republic 7243.0 0.729186 \n", "12 Islam 7489.0 0.753951 \n", "94 Islam 7668.0 0.771972 \n", "204 Islam 7841.0 0.789389 \n", "221 None 8005.0 0.805900 \n", "69 Islam 8156.0 0.821101 \n", "136 None 8297.0 0.835296 \n", "203 Central Africal Republic 8434.0 0.849089 \n", "28 Myanmar 8539.0 0.859660 \n", "11 Communism 8616.0 0.867412 \n", "163 Communism 8688.0 0.874660 \n", "212 Islam 8753.0 0.881204 \n", "64 None 8805.0 0.886439 \n", "138 None 8850.0 0.890969 \n", "5 Islam 8894.0 0.895399 \n", "103 Congo 8937.0 0.899728 \n", "112 Islam 8974.0 0.903453 \n", "92 Islam 9011.0 0.907178 \n", "38 Communism 9048.0 0.910903 \n", "48 Communism 9084.0 0.914527 \n", "8 Islam 9120.0 0.918152 \n", "150 Communism 9153.0 0.921474 \n", "30 None 9180.0 0.924192 \n", "113 None 9205.0 0.926709 \n", "118 None 9230.0 0.929226 \n", "201 None 9254.0 0.931642 \n", ".. ... ... ... \n", "70 None 9933.0 1.000000 \n", "77 Anarchy 9933.0 1.000000 \n", "173 Central Africal Republic 9933.0 1.000000 \n", "79 Islam 9933.0 1.000000 \n", "172 Islam 9933.0 1.000000 \n", "171 None 9933.0 1.000000 \n", "170 Communism 9933.0 1.000000 \n", "167 None 9933.0 1.000000 \n", "160 None 9933.0 1.000000 \n", "159 None 9933.0 1.000000 \n", "154 None 9933.0 1.000000 \n", "149 None 9933.0 1.000000 \n", "145 None 9933.0 1.000000 \n", "142 None 9933.0 1.000000 \n", "139 None 9933.0 1.000000 \n", "134 None 9933.0 1.000000 \n", "133 None 9933.0 1.000000 \n", "132 None 9933.0 1.000000 \n", "128 Congo 9933.0 1.000000 \n", "123 None 9933.0 1.000000 \n", "122 None 9933.0 1.000000 \n", "119 Central Africal Republic 9933.0 1.000000 \n", "110 Islam 9933.0 1.000000 \n", "104 Myanmar 9933.0 1.000000 \n", "87 Islam 9933.0 1.000000 \n", "85 None 9933.0 1.000000 \n", "81 Islam 9933.0 1.000000 \n", "229 None 9933.0 1.000000 \n", "50 None NaN NaN \n", "222 None NaN NaN \n", "\n", "[230 rows x 7 columns]" ] }, "execution_count": 116, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count['dead_total'] = count['dead'].cumsum()\n", "count['cum_frac'] = count['dead_total'] / count['dead'].sum()\n", "count" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [conda env:Python_Anaconda3]", "language": "python", "name": "conda-env-Python_Anaconda3-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.6" } }, "nbformat": 4, "nbformat_minor": 1 }