08 · Presentation Charts: "We Rely on Imports"¶
This notebook produces one chart for each data page of the carousel slides/We_Rely_on_Imports_Research.pdf, computed from the cleaned data. The analysis behind each number is in notebook 07. Every section prints the figures quoted on the page, then draws the chart and saves it to media/presentation/.
| Page | Topic | File |
|---|---|---|
| 2 | Most of our trade is imports | page02_trade_split.png |
| 3 | Trade dropped when the Strait of Hormuz was blocked | page03_trade_trend.png |
| 4 | Over a quarter of our trade was lost | page04_trade_shock.png |
| 5 | Exports beyond the Strait fell | page05_export_drops.png |
| 6 | Imports from beyond the Strait fell | page06_import_partners.png |
| 7 | Raw materials fell the most | page07_commodities.png |
| 8 | Many imports depended on one country | page08_concentration.png |
| 9 | Imports from beyond the Strait have not recovered | page09_gcc_vs_world.png |
| 10 | New suppliers are helping us recover | page10_alumina_suppliers.png |
%load_ext autoreload
%autoreload 2
import pandas as pd
import plotly.express as px
from scripts.analysis import load_trade, study_window, compare_years, pct_change, PRESENTATION_DIR
from scripts.plotly_theme import use_metro, RED, BLUE, ORANGE, GREEN, DARKBLUE, INK, MUTED, NEUTRAL, NEUTRAL2
use_metro()
pd.options.display.float_format = "{:,.1f}".format
PRESENTATION_DIR.mkdir(parents=True, exist_ok=True)
TYPE_COLORS = {"import": RED, "export": BLUE, "re-export": ORANGE}
REGION_COLORS = {"GCC": GREEN, "Non-GCC": RED}
df = load_trade()
window = study_window(df) # Feb–Sep 2025 and Feb–Sep 2026
imports = window[window["trade_type"] == "import"]
exports = window[window["trade_type"] == "export"]
Page 2 · Most of our trade is imports¶
Share of non-oil trade value by trade type, February–September 2025 (before the conflict).
trade_split = (
window[window["year"] == 2025]
.groupby("trade_type")["price_bhd"]
.sum()
.reset_index()
)
trade_split["value_bhd_m"] = trade_split["price_bhd"] / 1e6
trade_split["share_%"] = trade_split["price_bhd"] / trade_split["price_bhd"].sum() * 100
# raw materials processed for export (definition in notebook 07)
smelter_inputs = [28182000, 26011100, 27131100, 27131200, 27082000, 28261200]
imports_2025 = imports[imports["year"] == 2025]
raw_share = imports_2025[imports_2025["commodity_no"].isin(smelter_inputs)]["price_bhd"].sum() / imports_2025["price_bhd"].sum() * 100
print(f"Raw materials processed for export: {raw_share:.0f}% of imports")
trade_split[["trade_type", "value_bhd_m", "share_%"]]
fig = px.pie(
trade_split,
names="trade_type",
values="value_bhd_m",
hole=0.4,
color="trade_type",
color_discrete_map=TYPE_COLORS,
title="Share of Non-Oil Trade Value, Feb–Sep 2025",
)
fig.update_traces(textinfo="percent+label")
fig.write_image(PRESENTATION_DIR / "page02_trade_split.png", scale=2)
fig.show()
Page 3 · Trade dropped sharply when the Strait of Hormuz was blocked¶
Monthly trade value by type, February 2025 – September 2026.
monthly = (
df[df["date"] >= "2025-02-01"]
.groupby(["date", "trade_type"])["price_bhd"]
.sum()
.reset_index()
)
monthly["value_bhd_m"] = monthly["price_bhd"] / 1e6
fig = px.line(
monthly,
x="date",
y="value_bhd_m",
color="trade_type",
markers=True,
color_discrete_map=TYPE_COLORS,
)
fig.update_layout(
title="Monthly Non-Oil Trade Value, Feb 2025 – Sep 2026",
xaxis_title="Date",
yaxis_title="Trade Value (BHD m)",
legend_title_text="Trade Type"
)
# shade the months after the Strait of Hormuz was blocked
fig.add_vrect(
x0="2026-02-15",
x1="2026-09-15",
fillcolor=RED,
opacity=0.1,
line_width=0,
annotation_text="Strait of Hormuz blocked",
annotation_position="top left"
)
fig.write_image(PRESENTATION_DIR / "page03_trade_trend.png", scale=2)
fig.show()
Page 4 · Over a quarter of our trade was lost¶
February–September totals by trade type, 2025 vs 2026, plus the monthly import figures quoted on the page.
by_type = compare_years(window, "trade_type")
by_type[[2025, 2026, "change"]] = by_type[[2025, 2026, "change"]] / 1e6
total_change = pct_change(by_type[2026].sum(), by_type[2025].sum())
print(f"All trade: {total_change:+.1f}%")
monthly_wide = monthly.pivot(index="date", columns="trade_type", values="value_bhd_m")
print(f"Imports: Feb 2026 {monthly_wide.loc['2026-02-01', 'import']:.0f}m, Mar 2026 {monthly_wide.loc['2026-03-01', 'import']:.0f}m "
f"({pct_change(monthly_wide.loc['2026-03-01', 'import'], monthly_wide.loc['2026-02-01', 'import']):+.0f}%)")
print(f"Imports Sep 2026 vs Sep 2025: {pct_change(monthly_wide.loc['2026-09-01', 'import'], monthly_wide.loc['2025-09-01', 'import']):+.0f}%")
print(f"Exports Sep 2026 vs Sep 2025: {monthly_wide.loc['2026-09-01', 'export']:.0f}m vs {monthly_wide.loc['2025-09-01', 'export']:.0f}m "
f"({pct_change(monthly_wide.loc['2026-09-01', 'export'], monthly_wide.loc['2025-09-01', 'export']):+.0f}%)")
by_type
trade_shock = by_type.melt(
id_vars="trade_type",
value_vars=[2025, 2026],
var_name="year",
value_name="value_bhd_m",
)
trade_shock["year"] = trade_shock["year"].astype(str) # so plotly treats the year as a category
fig = px.bar(
trade_shock,
x="trade_type",
y="value_bhd_m",
color="year",
barmode="group",
text_auto=",.0f",
color_discrete_map={
"2025": NEUTRAL,
"2026": RED
}
)
fig.update_layout(
title="Non-Oil Trade, Feb–Sep 2025 vs 2026",
xaxis_title="Trade Type",
yaxis_title="Trade Value (BHD m)",
legend_title_text="Year"
)
fig.write_image(PRESENTATION_DIR / "page04_trade_shock.png", scale=2)
fig.show()
Page 5 · Exports beyond the Strait fell¶
Domestic exports to GCC and non-GCC markets, gas-based products, and the five largest drops by market and product.
exports_by_region = compare_years(exports, "region")
print(exports_by_region[["region", "pct_change"]].to_string(index=False))
gas_based = compare_years(exports[exports["commodity_no"].isin([31021000, 29051100])], "commodity_name")
print(gas_based[["commodity_name", "pct_change"]].to_string(index=False))
export_drops = compare_years(exports[exports["region"] == "Non-GCC"], ["country_name", "commodity_name"])
export_drops = export_drops.nsmallest(5, "change")
export_drops["change"] = export_drops["change"] / 1e6
export_drops["product"] = export_drops["commodity_name"].str.split(",").str[0].str.lower() # drop the long HS description
export_drops["label"] = export_drops["country_name"].str.title() + " – " + export_drops["product"]
export_drops[["label", "change"]]
fig = px.bar(
export_drops,
x="change",
y="label",
orientation="h",
text_auto=".0f",
)
fig.update_layout(
title="Biggest Export Drops to Non-GCC Markets, Feb–Sep 2026 vs 2025",
xaxis_title="Change (BHD m)",
yaxis_title="Market – Product",
)
fig.update_traces(marker_color=RED)
fig.update_yaxes(categoryorder="total descending")
fig.write_image(PRESENTATION_DIR / "page05_export_drops.png", scale=2)
fig.show()
Page 6 · Imports from beyond the Strait fell¶
The two largest GCC gains and the three largest losses in imports by partner.
imports_by_region = compare_years(imports, "region")
print(imports_by_region[["region", "pct_change"]].to_string(index=False))
gcc_share = imports.pivot_table(index="year", columns="region", values="price_bhd", aggfunc="sum")
gcc_share = gcc_share["GCC"] / gcc_share.sum(axis=1) * 100
print(f"GCC share of imports: {gcc_share[2025]:.0f}% -> {gcc_share[2026]:.0f}%")
partners = compare_years(imports, ["country_name", "region"])
import_partners = pd.concat([
partners[partners["region"] == "GCC"].nlargest(2, "change"),
partners.nsmallest(3, "change"),
])
import_partners["change"] = import_partners["change"] / 1e6
import_partners["country_name"] = import_partners["country_name"].str.title()
import_partners[["country_name", "region", "change", "pct_change"]]
fig = px.bar(
import_partners,
x="change",
y="country_name",
color="region",
orientation="h",
text_auto=".0f",
color_discrete_map=REGION_COLORS,
)
fig.update_layout(
title="Biggest Changes in Imports by Partner, Feb–Sep 2026 vs 2025",
xaxis_title="Change (BHD m)",
yaxis_title="Country",
legend_title_text="Region"
)
fig.update_yaxes(categoryorder="total ascending")
fig.write_image(PRESENTATION_DIR / "page06_import_partners.png", scale=2)
fig.show()
Page 7 · Raw materials fell the most¶
Change in imports for the six commodity categories shown on the page, with the main product behind each.
page_categories = [
"Mineral Products",
"Transportation",
"Machinery / Electrical",
"Chemicals & Allied Industries",
"Foodstuffs",
"Animal & Animal Products",
]
category_change = compare_years(imports, "commodity_category")
category_change = category_change[category_change["commodity_category"].isin(page_categories)]
# main products quoted on the page
products = compare_years(imports, ["commodity_no", "commodity_name"])
main_products = products[products["commodity_no"].isin([26011100, 84091000, 28182000, 17019911])]
print(main_products[["commodity_name", "pct_change"]].to_string(index=False))
category_change[["commodity_category", "pct_change"]]
fig = px.bar(
category_change,
x="pct_change",
y="commodity_category",
orientation="h",
text_auto=".0f",
color=category_change["pct_change"] > 0,
color_discrete_map={
True: GREEN,
False: RED
}
)
fig.update_layout(
title="Change in Imports by Category, Feb–Sep 2026 vs 2025",
xaxis_title="Change (%)",
yaxis_title="Category",
showlegend=False
)
fig.update_yaxes(categoryorder="total descending")
fig.update_traces(textangle=0)
fig.write_image(PRESENTATION_DIR / "page07_commodities.png", scale=2)
fig.show()
Page 8 · Many imports depended on one country¶
The six highlighted single-supplier products: each had one country supplying at least 60% of its Feb–Sep 2025 value (selection explained in notebook 07, §6).
page_products = {
28182000: "Alumina",
26011100: "Iron ore",
71081210: "Gold ingots",
85171300: "Smartphones",
27082000: "Pitch coke",
10063000: "Rice",
}
suppliers = (
imports_2025[imports_2025["commodity_no"].isin(page_products)]
.groupby(["commodity_no", "country_name", "region"])["price_bhd"]
.sum()
.reset_index()
)
suppliers["share_%"] = suppliers["price_bhd"] / suppliers.groupby("commodity_no")["price_bhd"].transform("sum") * 100
main_suppliers = suppliers.sort_values("share_%", ascending=False).drop_duplicates("commodity_no")
main_suppliers["product"] = main_suppliers["commodity_no"].map(page_products)
main_suppliers["label"] = main_suppliers["product"] + " (" + main_suppliers["country_name"].str.title() + ")"
six_share = suppliers["price_bhd"].sum() / imports_2025["price_bhd"].sum() * 100
print(f"{six_share:.0f}% of our imports were these six products")
main_suppliers[["product", "country_name", "share_%"]]
fig = px.bar(
main_suppliers,
x="share_%",
y="label",
color="region",
orientation="h",
text_auto=".0f",
color_discrete_map=REGION_COLORS,
)
fig.update_layout(
title="Share Supplied by the Main Country, Feb–Sep 2025",
xaxis_title="Main Supplier's Share (%)",
yaxis_title="Product (Main Supplier)",
legend_title_text="Region"
)
fig.add_vline(
x=60,
line_dash="dash",
annotation_text="60% from one country"
)
fig.update_yaxes(categoryorder="total ascending")
fig.write_image(PRESENTATION_DIR / "page08_concentration.png", scale=2)
fig.show()
Page 9 · Imports from beyond the Strait have not recovered¶
Monthly import index by region, October 2025 – September 2026. The pre-conflict average (January 2025 – February 2026) is 100.
region_monthly = (
df[(df["trade_type"] == "import") & (df["date"] >= "2025-01-01")]
.pivot_table(index="date", columns="region", values="price_bhd", aggfunc="sum")
)
baseline = region_monthly.loc["2025-01-01":"2026-02-01"].mean()
import_index = region_monthly / baseline * 100
import_index = import_index.loc["2025-10-01":]
print(f"September 2026: GCC {import_index['GCC'].iloc[-1]:.0f}, rest of world {import_index['Non-GCC'].iloc[-1]:.0f}")
import_index = import_index.reset_index().melt(id_vars="date", var_name="region", value_name="index")
fig = px.line(
import_index,
x="date",
y="index",
color="region",
markers=True,
color_discrete_map=REGION_COLORS,
)
fig.update_layout(
title="Monthly Import Index: GCC vs Rest of World",
xaxis_title="Date",
yaxis_title="Import Index (Pre-Conflict Average = 100)",
legend_title_text="Region"
)
fig.add_hline(
y=100,
line_dash="dot",
line_color=MUTED,
annotation_text="Pre-conflict level"
)
fig.write_image(PRESENTATION_DIR / "page09_gcc_vs_world.png", scale=2)
fig.show()
Page 10 · New suppliers are helping us recover¶
Alumina imports by supplier, share of value, February–September 2025 vs 2026.
alumina = (
imports[imports["commodity_no"] == 28182000]
.groupby(["year", "country_name"])["price_bhd"]
.sum()
.reset_index()
)
alumina["value_bhd_m"] = alumina["price_bhd"] / 1e6
alumina["share_%"] = alumina["price_bhd"] / alumina.groupby("year")["price_bhd"].transform("sum") * 100
# group the very small suppliers together
alumina.loc[alumina["share_%"] < 1, "country_name"] = "OTHER"
alumina = alumina.groupby(["year", "country_name"])[["value_bhd_m", "share_%"]].sum().reset_index()
alumina["year"] = alumina["year"].astype(str)
alumina["country_name"] = alumina["country_name"].str.title()
alumina.pivot(index="country_name", columns="year", values=["value_bhd_m", "share_%"]).fillna(0)
fig = px.bar(
alumina,
x="share_%",
y="year",
color="country_name",
orientation="h",
text_auto=".0f",
color_discrete_map={
"Australia": RED,
"Saudi Arabia": GREEN,
"Indonesia": DARKBLUE,
"India": ORANGE,
"Vietnam": BLUE,
"China": INK,
"Brazil": NEUTRAL2,
"Other": NEUTRAL
}
)
fig.update_layout(
title="Alumina Imports by Supplier, Feb–Sep 2025 vs 2026",
xaxis_title="Share of Alumina Imports (%)",
yaxis_title="Year",
legend_title_text="Supplier",
barmode="stack",
height=400
)
fig.write_image(PRESENTATION_DIR / "page10_alumina_suppliers.png", scale=2)
fig.show()
Page 11 · What we learned¶
| Finding | Figure | Recommended action |
|---|---|---|
| Regional suppliers held up | GCC imports +22%, rest of world −35% | Build regional supply: more GCC sourcing, with the King Fahd Causeway as a backup route for essentials. |
| Single suppliers were the weak point | 23% of imports were six single-supplier products | Line up a second supplier wherever one country supplies 60% or more, starting with alumina and iron ore. |
| Far export markets fell away | Non-GCC exports −47.5%, GCC flat | Grow regional export markets and plan alternative outbound routes for urea, methanol and aluminium. |
| Alternatives helped, near or far | Australia's alumina share 95% → 56% | Keep the new suppliers on contract after recovery, and compare them on unit cost and reliability. Most alternatives cost more per tonne (notebook 07, §7). |
Source: Bahrain Open Data Portal, Information & eGovernment Authority (iGA). February–September 2025 vs 2026.