Tirsvad 5d49a6a81b
TirSystem/git-workflows: CD / changes (push) Successful in 10s
TirSystem/git-workflows: CI / secret-scan (push) Successful in 11s
TirSystem/git-workflows: CI / validate (push) Successful in 20s
TirSystem/git-workflows: CI / opengrep (push) Successful in 56s
TirSystem/git-workflows: CI / release-check (push) Successful in 6s
TirSystem/git-workflows: CD / wait-for-ci (push) Successful in 1m36s
TirSystem/git-workflows: CD / release (push) Skipped
TirSystem/git-workflows: CD / publish-wiki (push) Skipped
TirSystem/git-workflows: CD / sync-metadata (push) Successful in 6s
TirSystem/git-workflows: CD / sync-milestones (push) Successful in 21s
Merge pull request 'RC-020 wiki review: Go' (#47) from rc-020-wiki-go into main
2026-11-22 21:10:48 +01:00
2026-11-23 04:06:53 +08:00
2026-11-22 20:06:29 +01:00

🚀 Fatal Force: deaths involving police in the United States

Day 100 assignment of the Udemy course "100 Days of Code: The Complete Python Pro Bootcamp": an analysis of the Washington Post database of fatal police shootings combined with US census data, for course participants who want to compare solutions and for visitors who want ideas.

📚 Table of Contents

🧭 Overview

The topic is sensitive. The charts describe counts and rates and make no claim about cause. Read each chart together with its caption and the wiki page of its step.

Folder Purpose
src/fatal_force/ The Python package: loading, cleaning, aggregation and plotting functions, each with a Doxygen comment.
src/notebooks/ The Jupyter notebook that follows the lecture steps.
tests/ The pytest tests of the package.
docs/ Project documents, screenshots (docs/screenshots/) and the wiki sources (docs/wiki/).

The package itself has no runtime dependencies. The notebook needs the optional analysis extra (polars, matplotlib, plotly, JupyterLab).

📋 Requirements

  • Python 3.14 or later (py -3.14 --version on Windows, python3.14 --version elsewhere).
  • Git.
  • The course data files (see the Setup section). They are not stored in this repository.

🛠️ Setup

Create and use a local virtual environment named .venv, then upgrade pip.

Windows PowerShell:

py -3.14 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[analysis,dev]"

Linux or macOS:

python3.14 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[analysis,dev]"

Download the course resource archive from the Day 100 lecture page, unpack it, and copy its CSV files into a data/ folder in the repository root. The folder is ignored by git.

▶️ Run

Start JupyterLab from the activated environment and open the notebook:

jupyter lab src/notebooks/fatal_force.ipynb

To build the Doxygen documentation of the source:

doxygen Doxyfile

🧪 Tests

python -m pytest

Before every push run the local static analysis with Opengrep:

powershell -File scripts/opengrep.ps1

🖼️ Screenshots

One screenshot per lecture step is added as each step is finished. Each step has a wiki page in English, Danish and Bahasa Malaysia that explains what the step taught.

Steps 1 and 2: data exploration and cleaning

Step 1: raw data exploration

Step 2: data after cleaning

Steps 3 to 6: poverty and high school graduation

Step 3: poverty rate by state

Step 4: graduation rate by state

Step 5: poverty and graduation as lines

Step 6: scatter plot with regression line

Steps 7 and 8: racial makeup and deaths by race

Step 7: racial makeup of each state

Step 8: people killed by race

Steps 9 to 15: who the people killed were

Step 9: deaths by gender

Step 10: age distribution

Step 11: age by manner of death

Step 12: armed and unarmed

Step 13: age by race

Step 14: mental illness

Step 15: threat level and fleeing

Steps 16 to 19: places and time

Step 16: ten cities with the most killings

Step 17: ratio by race in the top ten cities

Step 18: map of killings by state

Step 19: killings over time

📄 License

GNU Affero General Public License v3.0, see LICENSE.

📎 Appendix: Project documents

Document What it tells you
Business Case Why the project exists, its scope and success criteria
Stakeholder Analysis Who is involved; the stakeholder IDs used for owners and reviewers
Project Plan The gateways and their schedule
Milestones One document per gateway: Go/No-Go criteria and tasks
Artifact registry Where each artifact type lives, the next version, the PO language and domain
Framework README The framework this project uses
Framework changelog What changed in each framework release

S
Description
Udemy 100 Days of Code, Day 100: analyse deaths involving police in the United States with the Washington Post database and US census data. Python 3.14, Jupyter notebook, pytest, wiki in English, Danish and Bahasa Malaysia.
Readme AGPL-3.0
1.6 MiB
0 Stars 1 Watchers 0 Forks
v0.1.0
Latest
2026-11-22 21:05:32 +01:00
Languages
Python 56.7%
Jupyter Notebook 42.9%
Shell 0.2%
PowerShell 0.2%