Skip to content

Global Terrorism Database Analysis

Use GTD-like incident data to:

  • Visualize incidents over time
  • Compare regions
  • Identify major trend changes

This is a sensitive dataset. Focus on high-level aggregated analysis and avoid sensationalizing.

diagram GTD trend analysis pipeline mermaid
From raw incident records to a responsible, aggregated summary.
Load
import pandas as pd
 
df = pd.read_csv("data/gtd.csv")
print(df.head())
Incidents per year
import matplotlib.pyplot as plt
 
yearly = df.groupby("year").size()
 
plt.figure(figsize=(10, 4))
plt.plot(yearly.index, yearly.values)
plt.title("Incidents by year")
plt.xlabel("Year")
plt.ylabel("Count")
plt.tight_layout()
plt.show()
Top regions
import seaborn as sns
import matplotlib.pyplot as plt
 
regions = df["region"].value_counts().head(10).reset_index()
regions.columns = ["region", "count"]
 
plt.figure(figsize=(10, 4))
sns.barplot(data=regions, x="count", y="region")
plt.title("Top regions by incident count")
plt.tight_layout()
plt.show()
sketch Incidents by year p5.js
A single amber line shows the overall trend across years; annotate any sharp turns.
  • Overall trend
  • Top regions by incidents
  • Notes about missingness/reporting bias

Exercise 2 – Top regions by incident count

Section titled “Exercise 2 – Top regions by incident count”

Exercise 3 – Bucket missing region as “Unknown”

Section titled “Exercise 3 – Bucket missing region as “Unknown””

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading