1. Engineering reporting workflow overview

Crash engineering reporting sits at the intersection of field data collection, statistical analysis, and stakeholder communication. A typical highway safety program may generate tens of thousands of crash records per year, each carrying dozens of attributes: collision type, vehicle configuration, roadway geometry, weather, injury severity, and GPS coordinates. Turning that raw feed into a defensible, interactive report is not a single tool's job. It is a pipeline, and each stage of that pipeline has a natural owner. Python handles ingestion, cleaning, and computation. Excel handles structured review, spot-checking, and the tabular artifacts that engineers and reviewers already trust. Power BI handles the final mile: interactive dashboards that let planners, traffic engineers, and decision-makers explore the data without touching a script.

This chapter establishes the mental model for the entire course. Before writing a single line of pandas code or building a single DAX measure, you need to understand what flows between the three tools, in which direction, and why the boundaries sit where they do.

The Three-Stage Pipeline and What Each Stage Owns

The pipeline begins with raw crash logs. These arrive in inconsistent forms: CSV exports from a state crash database, fixed-width text files from an older mainframe system, Excel workbooks filled in by field officers, or JSON payloads from a mobile reporting app. The first stage is ingestion and normalization, and this is Python's territory. Libraries such as pandas, polars, and geopandas let you read heterogeneous sources, enforce consistent column names, parse dates, coerce numeric fields, and validate that required attributes are present. The output of this stage is a clean, typed, analysis-ready dataset — typically a Parquet file or a well-structured CSV.

The second stage is engineering analysis and review. Here Python continues to do the heavy computation: crash frequency by segment, equivalent property-damage-only (EPDO) scores, collision diagrams, severity distributions, and hot-spot identification. But this is also where Excel earns its place. Engineers and reviewers need to inspect intermediate tables, adjust assumptions, and sign off on numbers. A Python script can export a formatted workbook with summary tables, pivot-ready sheets, and a review tab where a reviewer flags anomalies. Excel is not a competitor to Python here; it is the human-facing checkpoint between computation and publication.

The third stage is interactive reporting. Power BI consumes the cleaned dataset (or a curated summary layer) and exposes it through slicers, maps, drill-through pages, and cross-filtering visuals. The dashboard does not recompute the analysis; it presents pre-aggregated or directly queryable results so that a user can ask "show me fatal crashes on rural curves in District 4 during winter" and get an answer in seconds.

Raw Crash Logs State CSV export Fixed-width text Field Excel forms Mobile JSON inconsistent schema missing fields Python ingest · clean · compute pandas / polars read schema + type validation EPDO / frequency calc hot-spot identification export Parquet + XLSX analysis-ready dataset Excel review · verify · sign-off summary tables pivot review sheets anomaly flags engineer sign-off human checkpoint Power BI explore · filter · drill slicers crash map drill-through cross-filter interactive dashboard raw → clean clean → verified verified → published

Why the Boundaries Matter

A common failure mode in crash reporting projects is letting one tool do everything. Teams that attempt to clean and analyze entirely inside Power Query end up with fragile, slow refresh cycles and no reproducible audit trail. Teams that attempt to publish directly from Python notebooks produce static outputs that stakeholders cannot explore. The three-tool split is not arbitrary; it reflects three genuinely different requirements: reproducibility (Python scripts are version-controlled and re-runnable), reviewability (Excel is the lingua franca of engineering review), and interactivity (Power BI is built for exploration).

Consider a concrete example. Suppose a district sends you a 42,000-row crash CSV for fiscal year 2024. Your Python ingestion script reads it, renames columns to a canonical schema (crash_id, crash_date, severity, route, milepost, latitude, longitude, collision_type), drops 312 duplicate crash_id values, flags 47 records with missing coordinates, and computes an EPDO score per record using the standard weighting (fatal = 12, injury = 3, PDO = 1, as a common illustrative convention). The script writes crashes_clean.parquet and a review workbook fy2024_review.xlsx. An engineer opens the workbook, notices that one route shows an implausible spike in January, traces it to a batch of records with milepost = 0, and flags them. You correct the ingestion rule, re-run, and only then does the dataset flow into the Power BI model.

Treat the Excel review step as a required gate, not an optional courtesy. If a number cannot survive a reviewer's spot-check in a pivot table, it should not appear on a dashboard.

Data Contracts Between Stages

Each handoff in the pipeline should be governed by an explicit contract. Between raw logs and Python, the contract is a schema specification: which columns are required, what types they carry, and what ranges are plausible. Between Python and Excel, the contract is a set of named tables with stable headers and a documented calculation methodology. Between Excel/Python and Power BI, the contract is a star schema: a fact table of crash records and dimension tables for date, route, district, and collision type.

Handoff Contract artifact Failure symptom if violated
Raw → Python Column schema + type rules Silent nulls, misparsed dates, string-typed mileposts
Python → Excel Named tables + methodology note Reviewer cannot reconcile totals; sign-off blocked
Excel/Python → Power BI Star schema + refresh schedule Broken relationships, wrong filter context, stale visuals

What "Done" Looks Like at Each Stage

Ingestion is done when the dataset passes validation: row counts reconcile against the source, required fields are non-null, coordinates fall within the jurisdiction boundary, and severity codes map to the accepted domain. Analysis is done when the computed metrics match an independent spot-check — for example, manually counting fatal crashes on one route in Excel and confirming the Python output agrees. Review is done when a qualified engineer has signed off on the summary tables. Publication is done when the Power BI dashboard refreshes on schedule, every visual responds correctly to slicers, and a drill-through from a district total reaches individual crash records.

Do not skip the reconciliation step between Python output and Excel spot-checks. A dashboard built on an unreconciled dataset will be trusted until the first stakeholder finds a discrepancy — and after that, it will not be trusted at all.

Where the Rest of This Course Goes

The chapters that follow build each stage in turn. You will write ingestion scripts that handle messy real-world exports, construct validation rules that catch bad records before they propagate, compute engineering metrics with documented formulas, assemble review workbooks that reviewers can actually use, and model the cleaned data in Power BI so that dashboards remain fast and correct as the underlying dataset grows. The pipeline overview in this chapter is the map; the remaining chapters are the terrain. Keep the three-stage boundary in mind as you work, and resist the temptation to collapse it — the separation between computation, review, and presentation is what makes a crash reporting system both defensible and maintainable.