In [2]:
from gtd import *
%matplotlib inline 
plt.style.use('seaborn-whitegrid')
pd.set_option('display.max_colwidth', -1)
summaryStatistics()


98773 global events observed
370 events observed in the United States
591 events observed outside the United States

In [3]:
Bar(OrderedDict(sorted(Counter(global_data.iyear).items())), title='Global Trend', ylabel='Attacks', rotation=270)


OrderedDict([(2001, 1907), (2002, 1332), (2003, 1262), (2004, 1162), (2005, 2009), (2006, 2749), (2007, 3241), (2008, 4803), (2009, 4719), (2010, 4822), (2011, 5071), (2012, 8500), (2013, 11996), (2014, 16860), (2015, 14852), (2016, 13488)])

In [4]:
Bar(OrderedDict(sorted(Counter(us_internal_data.iyear).items())), title='US Internal Trend', ylabel='Attacks', rotation=270)


OrderedDict([(2001, 41), (2002, 33), (2003, 32), (2004, 9), (2005, 20), (2006, 6), (2007, 9), (2008, 18), (2009, 10), (2010, 17), (2011, 10), (2012, 19), (2013, 20), (2014, 26), (2015, 39), (2016, 61)])

In [5]:
Bar(OrderedDict(sorted(Counter(us_external_data.iyear).items())), title='US External Trend', ylabel='Attacks', rotation=270)


OrderedDict([(2001, 28), (2002, 39), (2003, 65), (2004, 72), (2005, 78), (2006, 38), (2007, 39), (2008, 59), (2009, 20), (2010, 22), (2011, 20), (2012, 23), (2013, 15), (2014, 25), (2015, 22), (2016, 26)])

In [6]:
globalTrends()



In [7]:
correlation()


US Internal / Global Attacks: SpearmanrResult(correlation=0.23139334365020084, pvalue=0.3885312878524243)
US External / Global Attacks: SpearmanrResult(correlation=-0.69565387390378852, pvalue=0.0027675398043765973)
US External / US Internal: SpearmanrResult(correlation=-0.027326440177252588, pvalue=0.9199815614747453)

In [8]:
pieChart()



In [9]:
prepareAlQaidaData()
alQaidaTrends()



In [10]:
prepareIsilData()
isilTrends()



In [ ]: