twoHelixestwoHelixes Start free

Datasets / Hormuz shipping crisis

Daily transits through the strait, pre-war to crisis

Transits run flat until the closure, then step down and stay down: the period_type column marks the day the regime changes.

Question line chart of daily ship transits with the closure marked
Ship transits per day through the strait0255075100Jan 01Jan 11Jan 21Jan 31Feb 10Feb 20Mar 02Mar 12Mar 22Apr 01Apr 11Apr 21May 01Datepre_warwar_crisis
Hormuz shipping crisis — 125 rows charted from 125, drawn as a line
How it decided
Finding the data124 ms

Hormuz shipping crisis: 125 rows, 26 columns. date, period_type and daily_ship_transits.

Shaping the data12 ms

125 rows in, 125 out across 3 columns. Transits run flat until the closure, then step down and stay down: the period_type column marks the day the regime changes.

Choosing the chart17 ms

line. A daily series with a step change reads best as a line; the period split names the two regimes instead of a guessed annotation.

Applying defaults1 ms

Palette, spacing, axis titles and legend placement applied. 0 issues found.

The transformation

This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.

df["date"] = pd.to_datetime(df["date"])
result = df.groupby(["date", "period_type"], as_index=False)["daily_ship_transits"].sum()

What it charted

125 rows out of 125, 3 columns. First 8 shown.

dateperiod_typedaily_ship_transits
2026-01-01pre_war103
2026-01-02pre_war108
2026-01-03pre_war108
2026-01-04pre_war108
2026-01-05pre_war98
2026-01-06pre_war98
2026-01-07pre_war106
2026-01-08pre_war97

More from Hormuz shipping crisis