{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "247ef23c",
   "metadata": {},
   "source": [
    "# Climate Change Trend Analysis and Forecasting\n",
    "\n",
    "**IDEAS TIH Summer Internship 2026 — Intern Project**\n",
    "\n",
    "This notebook ingests open Greenhouse Gas (GHG) emissions data (Our World in Data CO<sub>2</sub> and\n",
    "GHG Emissions dataset), performs exploratory data analysis, engineers time-series features, trains and\n",
    "compares regression models, forecasts future emissions with a damped-trend exponential smoothing model,\n",
    "and simulates policy mitigation scenarios for 10 focus countries.\n",
    "\n",
    "*Scope note: this project deliberately focuses on classical machine learning and time-series methods —\n",
    "regression models and Holt's Damped Trend (ETS) forecasting — which are well suited to structured,\n",
    "annual, limited-length time series.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "096eb710",
   "metadata": {},
   "source": [
    "## Table of Contents\n",
    "\n",
    "- [Week 1: Data Acquisition, Exploration and Understanding](#week1)\n",
    "  - [1.1 Data Loading](#w1-1)\n",
    "  - [1.2 Data Profiling](#w1-2)\n",
    "  - [1.3 Exploratory Data Analysis](#w1-3)\n",
    "- [Week 2: Feature Engineering](#week2)\n",
    "  - [2.1 Time-Based Features](#w2-1)\n",
    "  - [2.2 Lag Features](#w2-2)\n",
    "  - [2.3 Per-Capita and Intensity Features](#w2-3)\n",
    "  - [2.4 Growth Rate Features](#w2-4)\n",
    "  - [2.5 Final Feature Dataset](#w2-5)\n",
    "- [Week 3: Baseline ML Models — Regression](#week3)\n",
    "  - [3.1 Problem Framing](#w3-1)\n",
    "  - [3.2 Train-Test Split](#w3-2)\n",
    "  - [3.3 Naive Baseline Model](#w3-3)\n",
    "  - [3.4 Linear Regression](#w3-4)\n",
    "  - [3.5 Random Forest Regressor](#w3-5)\n",
    "  - [3.6 Model Comparison Table](#w3-6)\n",
    "- [Week 4: Time-Series Forecasting with ETS(A,Ad,N) — Holt's Damped Trend](#week4)\n",
    "  - [4.1 Concept Introduction](#w4-1)\n",
    "  - [4.2 Model Fitting](#w4-2)\n",
    "  - [4.3 Forecasting to 2043](#w4-3)\n",
    "  - [4.4 Trend Interpretation](#w4-4)\n",
    "  - [4.5 Forecast Summary Table](#w4-5)\n",
    "  - [4.6 Model Validation](#w4-6)\n",
    "- [Week 5: Scenario Analysis](#week5)\n",
    "  - [5.1 Scenario Design](#w5-1)\n",
    "  - [5.2 Scenario Calculation](#w5-2)\n",
    "  - [5.3 Scenario Visualisations](#w5-3)\n",
    "  - [5.4 Impact Summary](#w5-4)\n",
    "- [Week 6: Conclusions and Limitations](#week6)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7083db3e",
   "metadata": {},
   "source": [
    "## Setup\n",
    "\n",
    "Import libraries, set global display/plotting options, and define the 10 focus countries used\n",
    "consistently throughout the project (a mix of major emitters, economies at different development\n",
    "stages, and countries with documented emissions-reduction trajectories such as the UK and Germany)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1d7e2adf",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:48.298249Z",
     "iopub.status.busy": "2026-07-29T14:01:48.297848Z",
     "iopub.status.idle": "2026-07-29T14:01:49.376327Z",
     "shell.execute_reply": "2026-07-29T14:01:49.375746Z"
    }
   },
   "outputs": [],
   "source": [
    "import warnings\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import plotly.express as px\n",
    "import plotly.graph_objects as go\n",
    "from plotly.subplots import make_subplots\n",
    "\n",
    "from sklearn.linear_model import LinearRegression\n",
    "from sklearn.ensemble import RandomForestRegressor\n",
    "from sklearn.preprocessing import LabelEncoder\n",
    "from sklearn.metrics import mean_absolute_error, mean_squared_error\n",
    "from statsmodels.tsa.holtwinters import ExponentialSmoothing\n",
    "\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "\n",
    "pd.set_option(\"display.max_columns\", 60)\n",
    "\n",
    "RANDOM_STATE = 42\n",
    "DATA_PATH = \"../data/owid-co2-data.csv\"\n",
    "\n",
    "# The 10 countries used consistently for all analysis, modelling, and scenario work\n",
    "COUNTRIES = [\n",
    "    \"China\", \"United States\", \"India\", \"Russia\", \"Japan\",\n",
    "    \"Germany\", \"Brazil\", \"United Kingdom\", \"South Africa\", \"Australia\",\n",
    "]\n",
    "\n",
    "# Consistent colour palette reused across every chart in this notebook\n",
    "COUNTRY_COLORS = dict(zip(COUNTRIES, px.colors.qualitative.Bold[:len(COUNTRIES)]))\n",
    "SCENARIO_COLORS = {\"BAU\": \"#1f77b4\", \"Moderate Mitigation\": \"#ff7f0e\", \"Aggressive Mitigation\": \"#2ca02c\"}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "393b9b38",
   "metadata": {},
   "source": [
    "<a id=\"week1\"></a>\n",
    "## Week 1: Data Acquisition, Exploration and Understanding\n",
    "\n",
    "*Learning objective: understand the structure and content of GHG datasets and produce a clean,\n",
    "profiled dataset ready for analysis.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "021cf8b6",
   "metadata": {},
   "source": [
    "<a id=\"w1-1\"></a>\n",
    "### 1.1 Data Loading\n",
    "\n",
    "We use the primary dataset for this project — Our World in Data's CO<sub>2</sub> and Greenhouse Gas\n",
    "Emissions dataset (`github.com/owid/co2-data`), downloaded as a CSV. It is a country-year panel\n",
    "covering CO<sub>2</sub>, methane, nitrous oxide and total GHG emissions alongside population, GDP and\n",
    "energy indicators."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6a430180",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.378337Z",
     "iopub.status.busy": "2026-07-29T14:01:49.378112Z",
     "iopub.status.idle": "2026-07-29T14:01:49.546891Z",
     "shell.execute_reply": "2026-07-29T14:01:49.546522Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Shape: (50411, 79)\n",
      "\n",
      "First 10 rows:\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>iso_code</th>\n",
       "      <th>population</th>\n",
       "      <th>gdp</th>\n",
       "      <th>cement_co2</th>\n",
       "      <th>cement_co2_per_capita</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_growth_abs</th>\n",
       "      <th>co2_growth_prct</th>\n",
       "      <th>co2_including_luc</th>\n",
       "      <th>co2_including_luc_growth_abs</th>\n",
       "      <th>co2_including_luc_growth_prct</th>\n",
       "      <th>co2_including_luc_per_capita</th>\n",
       "      <th>co2_including_luc_per_gdp</th>\n",
       "      <th>co2_including_luc_per_unit_energy</th>\n",
       "      <th>co2_per_capita</th>\n",
       "      <th>co2_per_gdp</th>\n",
       "      <th>co2_per_unit_energy</th>\n",
       "      <th>coal_co2</th>\n",
       "      <th>coal_co2_per_capita</th>\n",
       "      <th>consumption_co2</th>\n",
       "      <th>consumption_co2_per_capita</th>\n",
       "      <th>consumption_co2_per_gdp</th>\n",
       "      <th>cumulative_cement_co2</th>\n",
       "      <th>cumulative_co2</th>\n",
       "      <th>cumulative_co2_including_luc</th>\n",
       "      <th>cumulative_coal_co2</th>\n",
       "      <th>cumulative_flaring_co2</th>\n",
       "      <th>cumulative_gas_co2</th>\n",
       "      <th>...</th>\n",
       "      <th>other_co2_per_capita</th>\n",
       "      <th>other_industry_co2</th>\n",
       "      <th>primary_energy_consumption</th>\n",
       "      <th>share_global_cement_co2</th>\n",
       "      <th>share_global_co2</th>\n",
       "      <th>share_global_co2_including_luc</th>\n",
       "      <th>share_global_coal_co2</th>\n",
       "      <th>share_global_cumulative_cement_co2</th>\n",
       "      <th>share_global_cumulative_co2</th>\n",
       "      <th>share_global_cumulative_co2_including_luc</th>\n",
       "      <th>share_global_cumulative_coal_co2</th>\n",
       "      <th>share_global_cumulative_flaring_co2</th>\n",
       "      <th>share_global_cumulative_gas_co2</th>\n",
       "      <th>share_global_cumulative_luc_co2</th>\n",
       "      <th>share_global_cumulative_oil_co2</th>\n",
       "      <th>share_global_cumulative_other_co2</th>\n",
       "      <th>share_global_flaring_co2</th>\n",
       "      <th>share_global_gas_co2</th>\n",
       "      <th>share_global_luc_co2</th>\n",
       "      <th>share_global_oil_co2</th>\n",
       "      <th>share_global_other_co2</th>\n",
       "      <th>share_of_temperature_change_from_ghg</th>\n",
       "      <th>temperature_change_from_ch4</th>\n",
       "      <th>temperature_change_from_co2</th>\n",
       "      <th>temperature_change_from_ghg</th>\n",
       "      <th>temperature_change_from_n2o</th>\n",
       "      <th>total_ghg</th>\n",
       "      <th>total_ghg_excluding_lucf</th>\n",
       "      <th>trade_co2</th>\n",
       "      <th>trade_co2_share</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1750</td>\n",
       "      <td>AFG</td>\n",
       "      <td>2802560.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1751</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1752</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1753</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1754</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1755</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1756</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1757</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1758</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>1759</td>\n",
       "      <td>AFG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 79 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       country  year iso_code  population  gdp  cement_co2  \\\n",
       "0  Afghanistan  1750      AFG   2802560.0  NaN         0.0   \n",
       "1  Afghanistan  1751      AFG         NaN  NaN         0.0   \n",
       "2  Afghanistan  1752      AFG         NaN  NaN         0.0   \n",
       "3  Afghanistan  1753      AFG         NaN  NaN         0.0   \n",
       "4  Afghanistan  1754      AFG         NaN  NaN         0.0   \n",
       "5  Afghanistan  1755      AFG         NaN  NaN         0.0   \n",
       "6  Afghanistan  1756      AFG         NaN  NaN         0.0   \n",
       "7  Afghanistan  1757      AFG         NaN  NaN         0.0   \n",
       "8  Afghanistan  1758      AFG         NaN  NaN         0.0   \n",
       "9  Afghanistan  1759      AFG         NaN  NaN         0.0   \n",
       "\n",
       "   cement_co2_per_capita  co2  co2_growth_abs  co2_growth_prct  \\\n",
       "0                    0.0  NaN             NaN              NaN   \n",
       "1                    NaN  NaN             NaN              NaN   \n",
       "2                    NaN  NaN             NaN              NaN   \n",
       "3                    NaN  NaN             NaN              NaN   \n",
       "4                    NaN  NaN             NaN              NaN   \n",
       "5                    NaN  NaN             NaN              NaN   \n",
       "6                    NaN  NaN             NaN              NaN   \n",
       "7                    NaN  NaN             NaN              NaN   \n",
       "8                    NaN  NaN             NaN              NaN   \n",
       "9                    NaN  NaN             NaN              NaN   \n",
       "\n",
       "   co2_including_luc  co2_including_luc_growth_abs  \\\n",
       "0                NaN                           NaN   \n",
       "1                NaN                           NaN   \n",
       "2                NaN                           NaN   \n",
       "3                NaN                           NaN   \n",
       "4                NaN                           NaN   \n",
       "5                NaN                           NaN   \n",
       "6                NaN                           NaN   \n",
       "7                NaN                           NaN   \n",
       "8                NaN                           NaN   \n",
       "9                NaN                           NaN   \n",
       "\n",
       "   co2_including_luc_growth_prct  co2_including_luc_per_capita  \\\n",
       "0                            NaN                           NaN   \n",
       "1                            NaN                           NaN   \n",
       "2                            NaN                           NaN   \n",
       "3                            NaN                           NaN   \n",
       "4                            NaN                           NaN   \n",
       "5                            NaN                           NaN   \n",
       "6                            NaN                           NaN   \n",
       "7                            NaN                           NaN   \n",
       "8                            NaN                           NaN   \n",
       "9                            NaN                           NaN   \n",
       "\n",
       "   co2_including_luc_per_gdp  co2_including_luc_per_unit_energy  \\\n",
       "0                        NaN                                NaN   \n",
       "1                        NaN                                NaN   \n",
       "2                        NaN                                NaN   \n",
       "3                        NaN                                NaN   \n",
       "4                        NaN                                NaN   \n",
       "5                        NaN                                NaN   \n",
       "6                        NaN                                NaN   \n",
       "7                        NaN                                NaN   \n",
       "8                        NaN                                NaN   \n",
       "9                        NaN                                NaN   \n",
       "\n",
       "   co2_per_capita  co2_per_gdp  co2_per_unit_energy  coal_co2  \\\n",
       "0             NaN          NaN                  NaN       NaN   \n",
       "1             NaN          NaN                  NaN       NaN   \n",
       "2             NaN          NaN                  NaN       NaN   \n",
       "3             NaN          NaN                  NaN       NaN   \n",
       "4             NaN          NaN                  NaN       NaN   \n",
       "5             NaN          NaN                  NaN       NaN   \n",
       "6             NaN          NaN                  NaN       NaN   \n",
       "7             NaN          NaN                  NaN       NaN   \n",
       "8             NaN          NaN                  NaN       NaN   \n",
       "9             NaN          NaN                  NaN       NaN   \n",
       "\n",
       "   coal_co2_per_capita  consumption_co2  consumption_co2_per_capita  \\\n",
       "0                  NaN              NaN                         NaN   \n",
       "1                  NaN              NaN                         NaN   \n",
       "2                  NaN              NaN                         NaN   \n",
       "3                  NaN              NaN                         NaN   \n",
       "4                  NaN              NaN                         NaN   \n",
       "5                  NaN              NaN                         NaN   \n",
       "6                  NaN              NaN                         NaN   \n",
       "7                  NaN              NaN                         NaN   \n",
       "8                  NaN              NaN                         NaN   \n",
       "9                  NaN              NaN                         NaN   \n",
       "\n",
       "   consumption_co2_per_gdp  cumulative_cement_co2  cumulative_co2  \\\n",
       "0                      NaN                    0.0             NaN   \n",
       "1                      NaN                    0.0             NaN   \n",
       "2                      NaN                    0.0             NaN   \n",
       "3                      NaN                    0.0             NaN   \n",
       "4                      NaN                    0.0             NaN   \n",
       "5                      NaN                    0.0             NaN   \n",
       "6                      NaN                    0.0             NaN   \n",
       "7                      NaN                    0.0             NaN   \n",
       "8                      NaN                    0.0             NaN   \n",
       "9                      NaN                    0.0             NaN   \n",
       "\n",
       "   cumulative_co2_including_luc  cumulative_coal_co2  cumulative_flaring_co2  \\\n",
       "0                           NaN                  NaN                     NaN   \n",
       "1                           NaN                  NaN                     NaN   \n",
       "2                           NaN                  NaN                     NaN   \n",
       "3                           NaN                  NaN                     NaN   \n",
       "4                           NaN                  NaN                     NaN   \n",
       "5                           NaN                  NaN                     NaN   \n",
       "6                           NaN                  NaN                     NaN   \n",
       "7                           NaN                  NaN                     NaN   \n",
       "8                           NaN                  NaN                     NaN   \n",
       "9                           NaN                  NaN                     NaN   \n",
       "\n",
       "   cumulative_gas_co2  ...  other_co2_per_capita  other_industry_co2  \\\n",
       "0                 NaN  ...                   NaN                 NaN   \n",
       "1                 NaN  ...                   NaN                 NaN   \n",
       "2                 NaN  ...                   NaN                 NaN   \n",
       "3                 NaN  ...                   NaN                 NaN   \n",
       "4                 NaN  ...                   NaN                 NaN   \n",
       "5                 NaN  ...                   NaN                 NaN   \n",
       "6                 NaN  ...                   NaN                 NaN   \n",
       "7                 NaN  ...                   NaN                 NaN   \n",
       "8                 NaN  ...                   NaN                 NaN   \n",
       "9                 NaN  ...                   NaN                 NaN   \n",
       "\n",
       "   primary_energy_consumption  share_global_cement_co2  share_global_co2  \\\n",
       "0                         NaN                      NaN               NaN   \n",
       "1                         NaN                      NaN               NaN   \n",
       "2                         NaN                      NaN               NaN   \n",
       "3                         NaN                      NaN               NaN   \n",
       "4                         NaN                      NaN               NaN   \n",
       "5                         NaN                      NaN               NaN   \n",
       "6                         NaN                      NaN               NaN   \n",
       "7                         NaN                      NaN               NaN   \n",
       "8                         NaN                      NaN               NaN   \n",
       "9                         NaN                      NaN               NaN   \n",
       "\n",
       "   share_global_co2_including_luc  share_global_coal_co2  \\\n",
       "0                             NaN                    NaN   \n",
       "1                             NaN                    NaN   \n",
       "2                             NaN                    NaN   \n",
       "3                             NaN                    NaN   \n",
       "4                             NaN                    NaN   \n",
       "5                             NaN                    NaN   \n",
       "6                             NaN                    NaN   \n",
       "7                             NaN                    NaN   \n",
       "8                             NaN                    NaN   \n",
       "9                             NaN                    NaN   \n",
       "\n",
       "   share_global_cumulative_cement_co2  share_global_cumulative_co2  \\\n",
       "0                                 NaN                          NaN   \n",
       "1                                 NaN                          NaN   \n",
       "2                                 NaN                          NaN   \n",
       "3                                 NaN                          NaN   \n",
       "4                                 NaN                          NaN   \n",
       "5                                 NaN                          NaN   \n",
       "6                                 NaN                          NaN   \n",
       "7                                 NaN                          NaN   \n",
       "8                                 NaN                          NaN   \n",
       "9                                 NaN                          NaN   \n",
       "\n",
       "   share_global_cumulative_co2_including_luc  \\\n",
       "0                                        NaN   \n",
       "1                                        NaN   \n",
       "2                                        NaN   \n",
       "3                                        NaN   \n",
       "4                                        NaN   \n",
       "5                                        NaN   \n",
       "6                                        NaN   \n",
       "7                                        NaN   \n",
       "8                                        NaN   \n",
       "9                                        NaN   \n",
       "\n",
       "   share_global_cumulative_coal_co2  share_global_cumulative_flaring_co2  \\\n",
       "0                               NaN                                  NaN   \n",
       "1                               NaN                                  NaN   \n",
       "2                               NaN                                  NaN   \n",
       "3                               NaN                                  NaN   \n",
       "4                               NaN                                  NaN   \n",
       "5                               NaN                                  NaN   \n",
       "6                               NaN                                  NaN   \n",
       "7                               NaN                                  NaN   \n",
       "8                               NaN                                  NaN   \n",
       "9                               NaN                                  NaN   \n",
       "\n",
       "   share_global_cumulative_gas_co2  share_global_cumulative_luc_co2  \\\n",
       "0                              NaN                              NaN   \n",
       "1                              NaN                              NaN   \n",
       "2                              NaN                              NaN   \n",
       "3                              NaN                              NaN   \n",
       "4                              NaN                              NaN   \n",
       "5                              NaN                              NaN   \n",
       "6                              NaN                              NaN   \n",
       "7                              NaN                              NaN   \n",
       "8                              NaN                              NaN   \n",
       "9                              NaN                              NaN   \n",
       "\n",
       "   share_global_cumulative_oil_co2  share_global_cumulative_other_co2  \\\n",
       "0                              NaN                                NaN   \n",
       "1                              NaN                                NaN   \n",
       "2                              NaN                                NaN   \n",
       "3                              NaN                                NaN   \n",
       "4                              NaN                                NaN   \n",
       "5                              NaN                                NaN   \n",
       "6                              NaN                                NaN   \n",
       "7                              NaN                                NaN   \n",
       "8                              NaN                                NaN   \n",
       "9                              NaN                                NaN   \n",
       "\n",
       "   share_global_flaring_co2  share_global_gas_co2  share_global_luc_co2  \\\n",
       "0                       NaN                   NaN                   NaN   \n",
       "1                       NaN                   NaN                   NaN   \n",
       "2                       NaN                   NaN                   NaN   \n",
       "3                       NaN                   NaN                   NaN   \n",
       "4                       NaN                   NaN                   NaN   \n",
       "5                       NaN                   NaN                   NaN   \n",
       "6                       NaN                   NaN                   NaN   \n",
       "7                       NaN                   NaN                   NaN   \n",
       "8                       NaN                   NaN                   NaN   \n",
       "9                       NaN                   NaN                   NaN   \n",
       "\n",
       "   share_global_oil_co2  share_global_other_co2  \\\n",
       "0                   NaN                     NaN   \n",
       "1                   NaN                     NaN   \n",
       "2                   NaN                     NaN   \n",
       "3                   NaN                     NaN   \n",
       "4                   NaN                     NaN   \n",
       "5                   NaN                     NaN   \n",
       "6                   NaN                     NaN   \n",
       "7                   NaN                     NaN   \n",
       "8                   NaN                     NaN   \n",
       "9                   NaN                     NaN   \n",
       "\n",
       "   share_of_temperature_change_from_ghg  temperature_change_from_ch4  \\\n",
       "0                                   NaN                          NaN   \n",
       "1                                   NaN                          NaN   \n",
       "2                                   NaN                          NaN   \n",
       "3                                   NaN                          NaN   \n",
       "4                                   NaN                          NaN   \n",
       "5                                   NaN                          NaN   \n",
       "6                                   NaN                          NaN   \n",
       "7                                   NaN                          NaN   \n",
       "8                                   NaN                          NaN   \n",
       "9                                   NaN                          NaN   \n",
       "\n",
       "   temperature_change_from_co2  temperature_change_from_ghg  \\\n",
       "0                          NaN                          NaN   \n",
       "1                          NaN                          NaN   \n",
       "2                          NaN                          NaN   \n",
       "3                          NaN                          NaN   \n",
       "4                          NaN                          NaN   \n",
       "5                          NaN                          NaN   \n",
       "6                          NaN                          NaN   \n",
       "7                          NaN                          NaN   \n",
       "8                          NaN                          NaN   \n",
       "9                          NaN                          NaN   \n",
       "\n",
       "   temperature_change_from_n2o  total_ghg  total_ghg_excluding_lucf  \\\n",
       "0                          NaN        NaN                       NaN   \n",
       "1                          NaN        NaN                       NaN   \n",
       "2                          NaN        NaN                       NaN   \n",
       "3                          NaN        NaN                       NaN   \n",
       "4                          NaN        NaN                       NaN   \n",
       "5                          NaN        NaN                       NaN   \n",
       "6                          NaN        NaN                       NaN   \n",
       "7                          NaN        NaN                       NaN   \n",
       "8                          NaN        NaN                       NaN   \n",
       "9                          NaN        NaN                       NaN   \n",
       "\n",
       "   trade_co2  trade_co2_share  \n",
       "0        NaN              NaN  \n",
       "1        NaN              NaN  \n",
       "2        NaN              NaN  \n",
       "3        NaN              NaN  \n",
       "4        NaN              NaN  \n",
       "5        NaN              NaN  \n",
       "6        NaN              NaN  \n",
       "7        NaN              NaN  \n",
       "8        NaN              NaN  \n",
       "9        NaN              NaN  \n",
       "\n",
       "[10 rows x 79 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "raw_df = pd.read_csv(DATA_PATH)\n",
    "\n",
    "print(\"Shape:\", raw_df.shape)\n",
    "print(\"\\nFirst 10 rows:\")\n",
    "raw_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1071ded",
   "metadata": {},
   "source": [
    "Next, inspect the full column list and each column's data type to understand what fields are\n",
    "available before doing any filtering or feature work."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "e4952c4c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.548574Z",
     "iopub.status.busy": "2026-07-29T14:01:49.548424Z",
     "iopub.status.idle": "2026-07-29T14:01:49.553344Z",
     "shell.execute_reply": "2026-07-29T14:01:49.552837Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Column names (79 total):\n",
      "['country', 'year', 'iso_code', 'population', 'gdp', 'cement_co2', 'cement_co2_per_capita', 'co2', 'co2_growth_abs', 'co2_growth_prct', 'co2_including_luc', 'co2_including_luc_growth_abs', 'co2_including_luc_growth_prct', 'co2_including_luc_per_capita', 'co2_including_luc_per_gdp', 'co2_including_luc_per_unit_energy', 'co2_per_capita', 'co2_per_gdp', 'co2_per_unit_energy', 'coal_co2', 'coal_co2_per_capita', 'consumption_co2', 'consumption_co2_per_capita', 'consumption_co2_per_gdp', 'cumulative_cement_co2', 'cumulative_co2', 'cumulative_co2_including_luc', 'cumulative_coal_co2', 'cumulative_flaring_co2', 'cumulative_gas_co2', 'cumulative_luc_co2', 'cumulative_oil_co2', 'cumulative_other_co2', 'energy_per_capita', 'energy_per_gdp', 'flaring_co2', 'flaring_co2_per_capita', 'gas_co2', 'gas_co2_per_capita', 'ghg_excluding_lucf_per_capita', 'ghg_per_capita', 'land_use_change_co2', 'land_use_change_co2_per_capita', 'methane', 'methane_per_capita', 'nitrous_oxide', 'nitrous_oxide_per_capita', 'oil_co2', 'oil_co2_per_capita', 'other_co2_per_capita', 'other_industry_co2', 'primary_energy_consumption', 'share_global_cement_co2', 'share_global_co2', 'share_global_co2_including_luc', 'share_global_coal_co2', 'share_global_cumulative_cement_co2', 'share_global_cumulative_co2', 'share_global_cumulative_co2_including_luc', 'share_global_cumulative_coal_co2', 'share_global_cumulative_flaring_co2', 'share_global_cumulative_gas_co2', 'share_global_cumulative_luc_co2', 'share_global_cumulative_oil_co2', 'share_global_cumulative_other_co2', 'share_global_flaring_co2', 'share_global_gas_co2', 'share_global_luc_co2', 'share_global_oil_co2', 'share_global_other_co2', 'share_of_temperature_change_from_ghg', 'temperature_change_from_ch4', 'temperature_change_from_co2', 'temperature_change_from_ghg', 'temperature_change_from_n2o', 'total_ghg', 'total_ghg_excluding_lucf', 'trade_co2', 'trade_co2_share']\n",
      "\n",
      "Data types:\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "country                            str\n",
       "year                             int64\n",
       "iso_code                           str\n",
       "population                     float64\n",
       "gdp                            float64\n",
       "                                ...   \n",
       "temperature_change_from_n2o    float64\n",
       "total_ghg                      float64\n",
       "total_ghg_excluding_lucf       float64\n",
       "trade_co2                      float64\n",
       "trade_co2_share                float64\n",
       "Length: 79, dtype: object"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(\"Column names ({} total):\".format(len(raw_df.columns)))\n",
    "print(list(raw_df.columns))\n",
    "print(\"\\nData types:\")\n",
    "raw_df.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6bbd9eb5",
   "metadata": {},
   "source": [
    "**What the key columns represent:**\n",
    "\n",
    "- **`country`** — country or region name (includes real sovereign countries as well as aggregates\n",
    "  such as `World`, continents, and income-group buckets, which we filter out below).\n",
    "- **`year`** — calendar year of the observation (this dataset spans 1750–2024).\n",
    "- **`co2`** — annual territorial (production-based) CO<sub>2</sub> emissions, in million tonnes (Mt).\n",
    "- **`co2_per_capita`** — annual CO<sub>2</sub> emissions per person, in tonnes.\n",
    "- **`methane`** — annual methane (CH<sub>4</sub>) emissions, in million tonnes of CO<sub>2</sub>-equivalent.\n",
    "- **`nitrous_oxide`** — annual nitrous oxide (N<sub>2</sub>O) emissions, in million tonnes of\n",
    "  CO<sub>2</sub>-equivalent.\n",
    "- **`total_ghg`** — total GHG emissions (CO<sub>2</sub> + CH<sub>4</sub> + N<sub>2</sub>O, excluding\n",
    "  land-use change), in million tonnes of CO<sub>2</sub>-equivalent."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "431cceb7",
   "metadata": {},
   "source": [
    "<a id=\"w1-2\"></a>\n",
    "### 1.2 Data Profiling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "03f6c938",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.554747Z",
     "iopub.status.busy": "2026-07-29T14:01:49.554619Z",
     "iopub.status.idle": "2026-07-29T14:01:49.566057Z",
     "shell.execute_reply": "2026-07-29T14:01:49.565451Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Columns with the most missing data:\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pct_null_of_total_rows</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>share_global_cumulative_other_co2</th>\n",
       "      <td>95.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>share_global_other_co2</th>\n",
       "      <td>95.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>other_co2_per_capita</th>\n",
       "      <td>94.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cumulative_other_co2</th>\n",
       "      <td>93.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>other_industry_co2</th>\n",
       "      <td>93.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>consumption_co2_per_gdp</th>\n",
       "      <td>91.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>consumption_co2_per_capita</th>\n",
       "      <td>90.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_co2</th>\n",
       "      <td>90.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_co2_share</th>\n",
       "      <td>90.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>consumption_co2</th>\n",
       "      <td>89.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>energy_per_gdp</th>\n",
       "      <td>84.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>co2_including_luc_per_unit_energy</th>\n",
       "      <td>79.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>energy_per_capita</th>\n",
       "      <td>79.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>primary_energy_consumption</th>\n",
       "      <td>78.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>co2_per_unit_energy</th>\n",
       "      <td>78.52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   pct_null_of_total_rows\n",
       "share_global_cumulative_other_co2                   95.70\n",
       "share_global_other_co2                              95.70\n",
       "other_co2_per_capita                                94.73\n",
       "cumulative_other_co2                                93.55\n",
       "other_industry_co2                                  93.55\n",
       "consumption_co2_per_gdp                             91.18\n",
       "consumption_co2_per_capita                          90.79\n",
       "trade_co2                                           90.65\n",
       "trade_co2_share                                     90.65\n",
       "consumption_co2                                     89.98\n",
       "energy_per_gdp                                      84.55\n",
       "co2_including_luc_per_unit_energy                   79.90\n",
       "energy_per_capita                                   79.00\n",
       "primary_energy_consumption                          78.91\n",
       "co2_per_unit_energy                                 78.52"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "null_pct = (raw_df.isna().sum() / len(raw_df) * 100).round(2).sort_values(ascending=False)\n",
    "null_report = null_pct.to_frame(\"pct_null_of_total_rows\")\n",
    "print(\"Columns with the most missing data:\")\n",
    "null_report.head(15)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "880a7966",
   "metadata": {},
   "source": [
    "Next, check which countries and years have the most complete CO2 coverage, since sparse country-year\n",
    "combinations are candidates for exclusion."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7cf5a103",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.567382Z",
     "iopub.status.busy": "2026-07-29T14:01:49.567255Z",
     "iopub.status.idle": "2026-07-29T14:01:49.587300Z",
     "shell.execute_reply": "2026-07-29T14:01:49.586707Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Most complete CO2 coverage (top 15):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>first_year</th>\n",
       "      <th>last_year</th>\n",
       "      <th>n_years</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>country</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Australia</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Asia (excl. China and India)</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Asia</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe (excl. EU-27)</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe (excl. EU-28)</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>European Union (28)</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>High-income countries</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>New Zealand</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Taiwan</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>World</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United Kingdom</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Norway</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oceania</th>\n",
       "      <td>1750</td>\n",
       "      <td>2024</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Canada</th>\n",
       "      <td>1785</td>\n",
       "      <td>2024</td>\n",
       "      <td>240</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              first_year  last_year  n_years\n",
       "country                                                     \n",
       "Australia                           1750       2024      275\n",
       "Asia (excl. China and India)        1750       2024      275\n",
       "Asia                                1750       2024      275\n",
       "Europe                              1750       2024      275\n",
       "Europe (excl. EU-27)                1750       2024      275\n",
       "Europe (excl. EU-28)                1750       2024      275\n",
       "European Union (28)                 1750       2024      275\n",
       "High-income countries               1750       2024      275\n",
       "New Zealand                         1750       2024      275\n",
       "Taiwan                              1750       2024      275\n",
       "World                               1750       2024      275\n",
       "United Kingdom                      1750       2024      275\n",
       "Norway                              1750       2024      275\n",
       "Oceania                             1750       2024      275\n",
       "Canada                              1785       2024      240"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Which countries/years have the most complete co2 coverage?\n",
    "coverage = (\n",
    "    raw_df.dropna(subset=[\"co2\"])\n",
    "    .groupby(\"country\")[\"year\"]\n",
    "    .agg(first_year=\"min\", last_year=\"max\", n_years=\"count\")\n",
    "    .sort_values(\"n_years\", ascending=False)\n",
    ")\n",
    "print(\"Most complete CO2 coverage (top 15):\")\n",
    "coverage.head(15)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2dc0dc39",
   "metadata": {},
   "source": [
    "Also check how many countries report CO2 data in the most recent years, to gauge how current and\n",
    "broad the dataset's coverage is."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "57f0ac85",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.588920Z",
     "iopub.status.busy": "2026-07-29T14:01:49.588722Z",
     "iopub.status.idle": "2026-07-29T14:01:49.605917Z",
     "shell.execute_reply": "2026-07-29T14:01:49.605372Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of countries reporting CO2, most recent years:\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "year\n",
       "2015    247\n",
       "2016    247\n",
       "2017    247\n",
       "2018    247\n",
       "2019    247\n",
       "2020    247\n",
       "2021    247\n",
       "2022    247\n",
       "2023    247\n",
       "2024    247\n",
       "Name: country, dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Rows per year, to see which years have the broadest country coverage\n",
    "rows_per_year = raw_df.dropna(subset=[\"co2\"]).groupby(\"year\")[\"country\"].nunique()\n",
    "print(\"Number of countries reporting CO2, most recent years:\")\n",
    "rows_per_year.tail(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d68380f",
   "metadata": {},
   "source": [
    "**Filtering decisions.** We restrict the working dataset to:\n",
    "\n",
    "1. **`year >= 1990`** — this project's analysis, modelling, and forecasting all operate on the\n",
    "   post-1990 period, which has materially better data completeness across countries than earlier\n",
    "   decades and captures the modern emissions trajectory (including the post-Soviet transition, WTO-era\n",
    "   globalisation, and recent decarbonisation policy).\n",
    "2. **Sovereign countries only** — OWID includes aggregate rows (`World`, continents such as `Asia`/\n",
    "   `Europe`, and income-group buckets such as `High-income countries`) alongside individual countries.\n",
    "   These aggregates have no `iso_code` in this dataset, while every real country does, so we filter on\n",
    "   `iso_code.notna()` to keep only actual countries and drop double-counted aggregates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "67c8108c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.607246Z",
     "iopub.status.busy": "2026-07-29T14:01:49.607112Z",
     "iopub.status.idle": "2026-07-29T14:01:49.620363Z",
     "shell.execute_reply": "2026-07-29T14:01:49.619883Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rows before filtering: 50,411\n",
      "Rows after filtering:  7,630\n",
      "Countries retained:    218\n",
      "Aggregate rows removed (no iso_code): 7,931\n"
     ]
    }
   ],
   "source": [
    "df = raw_df[(raw_df[\"year\"] >= 1990) & (raw_df[\"iso_code\"].notna())].copy()\n",
    "\n",
    "print(f\"Rows before filtering: {len(raw_df):,}\")\n",
    "print(f\"Rows after filtering:  {len(df):,}\")\n",
    "print(f\"Countries retained:    {df['country'].nunique()}\")\n",
    "print(f\"Aggregate rows removed (no iso_code): {raw_df['iso_code'].isna().sum():,}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "43b911a4",
   "metadata": {},
   "source": [
    "<a id=\"w1-3\"></a>\n",
    "### 1.3 Exploratory Data Analysis (EDA)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e8a1b90f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:49.621880Z",
     "iopub.status.busy": "2026-07-29T14:01:49.621735Z",
     "iopub.status.idle": "2026-07-29T14:01:50.568597Z",
     "shell.execute_reply": "2026-07-29T14:01:50.568107Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "",
         "line": {
          "color": "#1f77b4",
          "dash": "solid",
          "width": 3
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "",
         "orientation": "v",
         "showlegend": false,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "bef7qRGq1UBuEoPAuiHWQN9PjZemc9VA6iYxCBys1UDVeOkmcd3VQFpkO9/XXNZAGy/dJD4D10DXo3A9Qh/XQDeJQWBd/9ZAhetRuBaA10CLbOf7ySTYQJqZmZlZU9hAQWDl0Jrd2EAOLbKdPzDaQAisHFr8DNtAbxKDwFL720BiEFg5ROfcQIGVQ4sMu91AO99PjQdC3kBnZmZmtsbdQOj7qfFSe99A2/l+arRK4ECZmZmZmYfgQNV46Sa1reBAukkMAtfE4EAtsp3vU7jgQIXrUbjetOBAd76fGq/54EDfT42XMlThQMP1KFzTf+FA8KfGS8fA4EDRItv5XpHhQNV46SYx2eFAfT81XmIR4kAbL90kwkLiQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Global CO2 Emissions by Sovereign Countries, 1990-2024"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "global_co2 = df.groupby(\"year\")[\"co2\"].sum().reset_index()\n",
    "\n",
    "fig = px.line(\n",
    "    global_co2, x=\"year\", y=\"co2\",\n",
    "    title=\"Global CO2 Emissions by Sovereign Countries, 1990-2024\",\n",
    "    labels={\"co2\": \"CO2 Emissions (Mt)\", \"year\": \"Year\"},\n",
    ")\n",
    "fig.update_traces(line_color=\"#1f77b4\", line_width=3)\n",
    "fig.update_layout(template=\"plotly_white\")\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "edb61d44",
   "metadata": {},
   "source": [
    "Next, compare CO2 trends for the five largest emitters individually, rather than only as a global\n",
    "total."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f3a9f8a4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.570389Z",
     "iopub.status.busy": "2026-07-29T14:01:50.570237Z",
     "iopub.status.idle": "2026-07-29T14:01:50.612922Z",
     "shell.execute_reply": "2026-07-29T14:01:50.612385Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "Country=China<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "China",
         "line": {
          "color": "rgb(127, 60, 141)",
          "dash": "solid",
          "width": 2.5
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "China",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "IbByaBFno0Coxks3SXakQK5H4XqUVqVAIbByaJHEpkB56SYxyCuoQKAaL91kLqpAHVpkO59Wq0AzMzMzs3CrQOkmMQisNqpAz/dT4+W7q0CF61G4nnesQH0/NV46GK1AkxgEVi4CsEBMN4lBQOOyQHWTGAT2WrRAVg4tsv35tkDD9ShcL1a5QD81XrqpPrtAlkOLbGdEvUBWDi2yfcm+QBsv3SQG0cBAJQaBlROYwkCHFtnOpxPDQGiR7Xwva8NAf2q8dAN8w0DsUbgeBUHDQGZmZmYWCsNAEoPAygGIw0DsUbgeZTXEQLgehevB7MRAnMQgsEJIxUDZzvdTMwrGQJZDi2zn38ZA1XjpJgHGx0D6fmq8hADIQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Country=India<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "India",
         "line": {
          "color": "rgb(57, 105, 172)",
          "dash": "solid",
          "width": 2.5
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "India",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "N4lBYOUPgkDJdr6fGjuDQAisHFpke4RAarx0kxgqhUDTTWIQWFCGQKRwPQrXw4dAiUFg5dC8iUArhxbZzs+KQCUGgZVDXotAZDvfT40JjkDsUbgehdiOQN0kBoGVSY9AAAAAAAAjkEA730+Nl7GQQG3n+6lxupFAUI2XbpKtkkAQWDm0SDWUQD0K16PwxZVAWDm0yHZJl0BaZDvfTzWZQIXrUbgeOppA4XoUrseWm0Bt5/up8RueQAIrhxZZLZ9AyXa+nxrIoECq8dJNom+hQK5H4XoUYaJAbef7qXHzokBiEFg5dEakQJqZmZlZZqRAWDm0yHbtokCTGARWjuekQCUGgZVDHqZAjZduEoPtp0D6fmq89PKoQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Country=Japan<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "Japan",
         "line": {
          "color": "rgb(231, 63, 116)",
          "dash": "solid",
          "width": 2.5
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Japan",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "9P3UeGkLkkCR7Xw/NTqSQIlBYOXQXZJAWmQ7309FkkASg8DKoRyTQKJFtvN9T5NA9ihcj8KCk0BSuB6F62OTQHWTGARWxZJARIts53tYk0BaZDvfz7CTQArXo3C9d5NASOF6FK7tk0B7FK5HYQ+UQHNoke18/JNAz/dT46UZlED2KFyPwr2TQDeJQWDlS5RAaJHtfL8yk0CNl24SAyGSQI/C9Shc7JJATmIQWLm0k0DLoUW2c1iUQC/dJAaBf5RADAIrhxaxk0CwcmiR7Q+TQKwcWmS7v5JAIbByaJGBkkAzMzMzM8qRQJhuEoNAOJFAcT0K1yM1kEBeukkMAoqQQK5H4XqUFpBA4XoUrkfXjkAOLbKd7w6OQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Country=Russia<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "Russia",
         "line": {
          "color": "rgb(242, 183, 1)",
          "dash": "solid",
          "width": 2.5
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Russia",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "IbByaJHQo0AQWDm0SM+iQEa28/3UrZ5AmpmZmRkqnUAv3SQGgbuZQKAaL90kSZlAeekmMYjKmEBg5dAi2yeXQA4tsp1v55ZAMQisHFpYl0D8qfHSTSKXQOf7qfFSuJdAuB6F61GRl0AbL90kBgyYQPT91HhpJZhAUrgehetvmEDByqFFtl2ZQPYoXI9CYZlAgZVDi+zSmUBt5/up8SSYQAwCK4eWhJlA+n5qvPRTmkAj2/l+apCaQKabxCAwlplAObTIdj6VmUDl0CLb+YyZQFpkO99PdZlANV66SQz0mUBxPQrXo7eaQHWTGATWoZpA+FPjpZt/mUBqvHSTGCqaQNNNYhDYLZpA16NwPYoUm0BqvHSTGNKbQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Country=United States<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "United States",
         "line": {
          "color": "rgb(17, 165, 121)",
          "dash": "solid",
          "width": 2.5
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "United States",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "QmDl0MILtEA/NV66adSzQOxRuB7FOrRA7FG4HoWftEBzaJHt3PG0QMHKoUXWMbVA001iEBjhtUCgGi/dJCm2QI/C9ShcaLZALbKd70eotkDFILByKIe3QFpkO9+PD7dAbef7qdE7t0A9CtejcHa3QFK4HoWL37dASgwCK+fut0B/arx0U523QG8Sg8CK6bdAarx0kzgft0DJdr6fGm61QAAAAABAJbZAAiuHFvmitUA730+Nd9O0QA4tsp1vYbVA9ihcj2KbtUAdWmQ7f/i0QCcxCKxcfbRAbxKDwGpLtEDb+X5qPPG0QPT91Hjpc7RAYhBYOfRRskDb+X5qHJyzQEoMAitnv7NAeekmMWg2s0CF61G4HiizQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "Country"
         },
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "CO2 Emission Trends for the Top 5 Emitting Countries, 1990-2024"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "top5_emitters = [\"China\", \"United States\", \"India\", \"Russia\", \"Japan\"]\n",
    "top5_df = df[df[\"country\"].isin(top5_emitters)]\n",
    "\n",
    "fig = px.line(\n",
    "    top5_df, x=\"year\", y=\"co2\", color=\"country\",\n",
    "    title=\"CO2 Emission Trends for the Top 5 Emitting Countries, 1990-2024\",\n",
    "    labels={\"co2\": \"CO2 Emissions (Mt)\", \"year\": \"Year\", \"country\": \"Country\"},\n",
    "    color_discrete_map=COUNTRY_COLORS,\n",
    ")\n",
    "fig.update_traces(line_width=2.5)\n",
    "fig.update_layout(template=\"plotly_white\", legend_title_text=\"Country\")\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "02dd8ea7",
   "metadata": {},
   "source": [
    "Finally, break down total GHG emissions by gas type (CO2, methane, nitrous oxide) per decade to see\n",
    "whether the composition of the gas mix has shifted over time."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "892381ea",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.614331Z",
     "iopub.status.busy": "2026-07-29T14:01:50.614207Z",
     "iopub.status.idle": "2026-07-29T14:01:50.659549Z",
     "shell.execute_reply": "2026-07-29T14:01:50.659098Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "Gas=CO2<br>Decade=%{x}<br>Share (%)=%{y}<extra></extra>",
         "legendgroup": "CO2",
         "marker": {
          "color": "rgb(136, 204, 238)",
          "pattern": {
           "shape": ""
          }
         },
         "name": "CO2",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "1990s",
          "2000s",
          "2010s",
          "2020s"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "byUU0WKRUUCgY80OBEJSQIZUr7oSw1JA2i9tTg+7UkA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Gas=Methane (CH4)<br>Decade=%{x}<br>Share (%)=%{y}<extra></extra>",
         "legendgroup": "Methane (CH4)",
         "marker": {
          "color": "rgb(204, 102, 119)",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Methane (CH4)",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "1990s",
          "2000s",
          "2010s",
          "2020s"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "I2fxi2+cNkDLOOsDnXg0QBi4rlCY8TJAXbHCu8UXM0A=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Gas=Nitrous Oxide (N2O)<br>Decade=%{x}<br>Share (%)=%{y}<extra></extra>",
         "legendgroup": "Nitrous Oxide (N2O)",
         "marker": {
          "color": "rgb(221, 204, 119)",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Nitrous Oxide (N2O)",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "1990s",
          "2000s",
          "2010s",
          "2020s"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "dgz4vhR4HEDY4nwDS/0ZQEPXTxJzCBhA6TwiKvTvF0A=",
          "dtype": "f8"
         },
         "yaxis": "y"
        }
       ],
       "layout": {
        "barmode": "stack",
        "legend": {
         "title": {
          "text": "Gas"
         },
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Share of Total Global GHG Emissions by Gas Type, per Decade"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Decade"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Share (%)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "decade_df = df.copy()\n",
    "decade_df[\"decade\"] = (decade_df[\"year\"] // 10 * 10).astype(str) + \"s\"\n",
    "decade_df = decade_df[decade_df[\"decade\"].isin([\"1990s\", \"2000s\", \"2010s\", \"2020s\"])]\n",
    "\n",
    "gas_by_decade = (\n",
    "    decade_df.groupby(\"decade\")[[\"co2\", \"methane\", \"nitrous_oxide\"]]\n",
    "    .sum()\n",
    "    .rename(columns={\"co2\": \"CO2\", \"methane\": \"Methane (CH4)\", \"nitrous_oxide\": \"Nitrous Oxide (N2O)\"})\n",
    ")\n",
    "gas_share = gas_by_decade.div(gas_by_decade.sum(axis=1), axis=0) * 100\n",
    "gas_share_long = gas_share.reset_index().melt(id_vars=\"decade\", var_name=\"Gas\", value_name=\"Share (%)\")\n",
    "\n",
    "fig = px.bar(\n",
    "    gas_share_long, x=\"decade\", y=\"Share (%)\", color=\"Gas\",\n",
    "    title=\"Share of Total Global GHG Emissions by Gas Type, per Decade\",\n",
    "    labels={\"decade\": \"Decade\"},\n",
    "    color_discrete_sequence=px.colors.qualitative.Safe,\n",
    ")\n",
    "fig.update_layout(template=\"plotly_white\", barmode=\"stack\")\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ceef73e",
   "metadata": {},
   "source": [
    "**Summary of observed patterns:**\n",
    "\n",
    "Global CO<sub>2</sub> emissions from sovereign countries have risen substantially since 1990, with\n",
    "growth accelerating sharply after China's WTO accession in the early 2000s and a brief dip around\n",
    "2020 caused by the COVID-19 pandemic. Among the top 5 emitters, China and India show strong sustained\n",
    "growth over the period — China overtaking the United States as the largest single emitter in the\n",
    "mid-2000s — while the United States and Japan show comparatively flat or gently declining trends and\n",
    "Russia shows a sharp drop around the 1991 Soviet collapse followed by a slow recovery. In the gas-mix\n",
    "breakdown, CO<sub>2</sub> is consistently the dominant contributor to total GHG emissions across every\n",
    "decade, with methane the second largest share and nitrous oxide a small but persistent component;\n",
    "CO<sub>2</sub>'s share has crept up slightly in more recent decades as fossil energy use has grown\n",
    "faster than agricultural methane sources globally."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fa5bef7f",
   "metadata": {},
   "source": [
    "<a id=\"week2\"></a>\n",
    "## Week 2: Feature Engineering\n",
    "\n",
    "*Learning objective: transform raw emissions data into a structured, model-ready feature set that\n",
    "captures temporal patterns and relationships between variables.*\n",
    "\n",
    "From this point on, all analysis, modelling, and scenario work is restricted to the 10 focus countries."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "f49ac656",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.661317Z",
     "iopub.status.busy": "2026-07-29T14:01:50.661190Z",
     "iopub.status.idle": "2026-07-29T14:01:50.670753Z",
     "shell.execute_reply": "2026-07-29T14:01:50.670299Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rows: 350  |  Countries: 10  |  Years: 1990-2024\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>co2</th>\n",
       "      <th>population</th>\n",
       "      <th>gdp</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1990</td>\n",
       "      <td>278.061</td>\n",
       "      <td>17126304.0</td>\n",
       "      <td>4.641366e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1991</td>\n",
       "      <td>279.437</td>\n",
       "      <td>17353191.0</td>\n",
       "      <td>4.613021e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1992</td>\n",
       "      <td>284.433</td>\n",
       "      <td>17549286.0</td>\n",
       "      <td>4.786337e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1993</td>\n",
       "      <td>288.780</td>\n",
       "      <td>17722905.0</td>\n",
       "      <td>5.015248e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1994</td>\n",
       "      <td>293.613</td>\n",
       "      <td>17897433.0</td>\n",
       "      <td>5.279932e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     country  year      co2  population           gdp\n",
       "0  Australia  1990  278.061  17126304.0  4.641366e+11\n",
       "1  Australia  1991  279.437  17353191.0  4.613021e+11\n",
       "2  Australia  1992  284.433  17549286.0  4.786337e+11\n",
       "3  Australia  1993  288.780  17722905.0  5.015248e+11\n",
       "4  Australia  1994  293.613  17897433.0  5.279932e+11"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "base = (\n",
    "    df[df[\"country\"].isin(COUNTRIES)]\n",
    "    .sort_values([\"country\", \"year\"])\n",
    "    .reset_index(drop=True)\n",
    "    .copy()\n",
    ")\n",
    "print(f\"Rows: {len(base)}  |  Countries: {base['country'].nunique()}  |  \"\n",
    "      f\"Years: {base['year'].min()}-{base['year'].max()}\")\n",
    "base[[\"country\", \"year\", \"co2\", \"population\", \"gdp\"]].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ede25e6",
   "metadata": {},
   "source": [
    "<a id=\"w2-1\"></a>\n",
    "### 2.1 Time-Based Features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "ff9185c4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.672258Z",
     "iopub.status.busy": "2026-07-29T14:01:50.672112Z",
     "iopub.status.idle": "2026-07-29T14:01:50.683179Z",
     "shell.execute_reply": "2026-07-29T14:01:50.682630Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>decade</th>\n",
       "      <th>years_since_1990</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_5yr_rolling_mean</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1990</td>\n",
       "      <td>1990s</td>\n",
       "      <td>0</td>\n",
       "      <td>278.061</td>\n",
       "      <td>278.061000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1991</td>\n",
       "      <td>1990s</td>\n",
       "      <td>1</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.749000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1992</td>\n",
       "      <td>1990s</td>\n",
       "      <td>2</td>\n",
       "      <td>284.433</td>\n",
       "      <td>280.643667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1993</td>\n",
       "      <td>1990s</td>\n",
       "      <td>3</td>\n",
       "      <td>288.780</td>\n",
       "      <td>282.677750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1994</td>\n",
       "      <td>1990s</td>\n",
       "      <td>4</td>\n",
       "      <td>293.613</td>\n",
       "      <td>284.864800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1995</td>\n",
       "      <td>1990s</td>\n",
       "      <td>5</td>\n",
       "      <td>304.962</td>\n",
       "      <td>290.245000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1996</td>\n",
       "      <td>1990s</td>\n",
       "      <td>6</td>\n",
       "      <td>311.851</td>\n",
       "      <td>296.727800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1997</td>\n",
       "      <td>1990s</td>\n",
       "      <td>7</td>\n",
       "      <td>320.243</td>\n",
       "      <td>303.889800</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     country  year decade  years_since_1990      co2  co2_5yr_rolling_mean\n",
       "0  Australia  1990  1990s                 0  278.061            278.061000\n",
       "1  Australia  1991  1990s                 1  279.437            278.749000\n",
       "2  Australia  1992  1990s                 2  284.433            280.643667\n",
       "3  Australia  1993  1990s                 3  288.780            282.677750\n",
       "4  Australia  1994  1990s                 4  293.613            284.864800\n",
       "5  Australia  1995  1990s                 5  304.962            290.245000\n",
       "6  Australia  1996  1990s                 6  311.851            296.727800\n",
       "7  Australia  1997  1990s                 7  320.243            303.889800"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "base[\"decade\"] = (base[\"year\"] // 10 * 10).astype(str) + \"s\"\n",
    "base[\"years_since_1990\"] = base[\"year\"] - 1990\n",
    "\n",
    "# 5-year rolling average of CO2, computed independently per country\n",
    "base[\"co2_5yr_rolling_mean\"] = (\n",
    "    base.groupby(\"country\")[\"co2\"]\n",
    "    .transform(lambda s: s.rolling(window=5, min_periods=1).mean())\n",
    ")\n",
    "\n",
    "base[[\"country\", \"year\", \"decade\", \"years_since_1990\", \"co2\", \"co2_5yr_rolling_mean\"]].head(8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2e68ae02",
   "metadata": {},
   "source": [
    "<a id=\"w2-2\"></a>\n",
    "### 2.2 Lag Features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "fd2ea236",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.684663Z",
     "iopub.status.busy": "2026-07-29T14:01:50.684526Z",
     "iopub.status.idle": "2026-07-29T14:01:50.695149Z",
     "shell.execute_reply": "2026-07-29T14:01:50.694727Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_lag1</th>\n",
       "      <th>co2_lag2</th>\n",
       "      <th>co2_lag3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1990</td>\n",
       "      <td>278.061</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1991</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1992</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1993</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1994</td>\n",
       "      <td>293.613</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1995</td>\n",
       "      <td>304.962</td>\n",
       "      <td>293.613</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1996</td>\n",
       "      <td>311.851</td>\n",
       "      <td>304.962</td>\n",
       "      <td>293.613</td>\n",
       "      <td>288.780</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1997</td>\n",
       "      <td>320.243</td>\n",
       "      <td>311.851</td>\n",
       "      <td>304.962</td>\n",
       "      <td>293.613</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     country  year      co2  co2_lag1  co2_lag2  co2_lag3\n",
       "0  Australia  1990  278.061       NaN       NaN       NaN\n",
       "1  Australia  1991  279.437   278.061       NaN       NaN\n",
       "2  Australia  1992  284.433   279.437   278.061       NaN\n",
       "3  Australia  1993  288.780   284.433   279.437   278.061\n",
       "4  Australia  1994  293.613   288.780   284.433   279.437\n",
       "5  Australia  1995  304.962   293.613   288.780   284.433\n",
       "6  Australia  1996  311.851   304.962   293.613   288.780\n",
       "7  Australia  1997  320.243   311.851   304.962   293.613"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for lag in (1, 2, 3):\n",
    "    base[f\"co2_lag{lag}\"] = base.groupby(\"country\")[\"co2\"].shift(lag)\n",
    "\n",
    "base[[\"country\", \"year\", \"co2\", \"co2_lag1\", \"co2_lag2\", \"co2_lag3\"]].head(8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b24f844d",
   "metadata": {},
   "source": [
    "**Why lag features matter.** Lag features (e.g. `co2_lag1` = last year's emissions for the same\n",
    "country) give a supervised model direct access to the most recent history of the series it is trying\n",
    "to predict. Emissions are highly autocorrelated year-to-year — a country's emissions this year are one\n",
    "of the best predictors of its emissions next year — so lag features let a standard regression model\n",
    "approximate autoregressive time-series behaviour without needing a dedicated time-series model.\n",
    "Multiple lags (1, 2, and 3 years back) also let the model pick up short-term acceleration or\n",
    "deceleration in the trend, not just the most recent level."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec93836b",
   "metadata": {},
   "source": [
    "<a id=\"w2-3\"></a>\n",
    "### 2.3 Per-Capita and Intensity Features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "8aecbd98",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.696776Z",
     "iopub.status.busy": "2026-07-29T14:01:50.696643Z",
     "iopub.status.idle": "2026-07-29T14:01:50.709504Z",
     "shell.execute_reply": "2026-07-29T14:01:50.708980Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>computed_per_capita</th>\n",
       "      <th>reported_per_capita</th>\n",
       "      <th>diff</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>1990</td>\n",
       "      <td>2.153</td>\n",
       "      <td>2.153</td>\n",
       "      <td>-0.0001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>China</td>\n",
       "      <td>2010</td>\n",
       "      <td>6.370</td>\n",
       "      <td>6.370</td>\n",
       "      <td>0.0004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>China</td>\n",
       "      <td>2023</td>\n",
       "      <td>8.556</td>\n",
       "      <td>8.556</td>\n",
       "      <td>0.0003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>United States</td>\n",
       "      <td>1990</td>\n",
       "      <td>20.254</td>\n",
       "      <td>20.254</td>\n",
       "      <td>-0.0003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>United States</td>\n",
       "      <td>2010</td>\n",
       "      <td>18.225</td>\n",
       "      <td>18.225</td>\n",
       "      <td>0.0004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>United States</td>\n",
       "      <td>2023</td>\n",
       "      <td>14.319</td>\n",
       "      <td>14.319</td>\n",
       "      <td>0.0005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>India</td>\n",
       "      <td>1990</td>\n",
       "      <td>0.668</td>\n",
       "      <td>0.668</td>\n",
       "      <td>0.0002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>India</td>\n",
       "      <td>2010</td>\n",
       "      <td>1.350</td>\n",
       "      <td>1.350</td>\n",
       "      <td>-0.0001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>India</td>\n",
       "      <td>2023</td>\n",
       "      <td>2.130</td>\n",
       "      <td>2.130</td>\n",
       "      <td>-0.0002</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         country  year  computed_per_capita  reported_per_capita    diff\n",
       "0          China  1990                2.153                2.153 -0.0001\n",
       "1          China  2010                6.370                6.370  0.0004\n",
       "2          China  2023                8.556                8.556  0.0003\n",
       "3  United States  1990               20.254               20.254 -0.0003\n",
       "4  United States  2010               18.225               18.225  0.0004\n",
       "5  United States  2023               14.319               14.319  0.0005\n",
       "6          India  1990                0.668                0.668  0.0002\n",
       "7          India  2010                1.350                1.350 -0.0001\n",
       "8          India  2023                2.130                2.130 -0.0002"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Cross-check co2_per_capita = co2 (Mt) * 1e6 / population, for 3 countries x 3 years\n",
    "check_years = [1990, 2010, 2023]\n",
    "check_countries = [\"China\", \"United States\", \"India\"]\n",
    "\n",
    "check_rows = []\n",
    "for country in check_countries:\n",
    "    for y in check_years:\n",
    "        row = base[(base[\"country\"] == country) & (base[\"year\"] == y)]\n",
    "        if row.empty:\n",
    "            continue\n",
    "        computed = row[\"co2\"].values[0] * 1e6 / row[\"population\"].values[0]\n",
    "        reported = row[\"co2_per_capita\"].values[0]\n",
    "        check_rows.append({\n",
    "            \"country\": country, \"year\": y,\n",
    "            \"computed_per_capita\": round(computed, 3),\n",
    "            \"reported_per_capita\": round(reported, 3),\n",
    "            \"diff\": round(computed - reported, 4),\n",
    "        })\n",
    "\n",
    "pd.DataFrame(check_rows)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5eaf1e4d",
   "metadata": {},
   "source": [
    "The computed values match OWID's reported `co2_per_capita` to within rounding error, confirming the\n",
    "column is simply `co2 * 1e6 / population` (tonnes per person)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "273ff456",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.710872Z",
     "iopub.status.busy": "2026-07-29T14:01:50.710749Z",
     "iopub.status.idle": "2026-07-29T14:01:50.717960Z",
     "shell.execute_reply": "2026-07-29T14:01:50.717504Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Country-years where ghg_intensity could not be computed (missing/zero GDP): 20\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>Australia</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>Australia</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>China</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>China</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>Germany</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>Germany</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>India</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>India</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>208</th>\n",
       "      <td>Japan</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209</th>\n",
       "      <td>Japan</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>Russia</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244</th>\n",
       "      <td>Russia</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>278</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>279</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>313</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>314</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>348</th>\n",
       "      <td>United States</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>349</th>\n",
       "      <td>United States</td>\n",
       "      <td>2024</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            country  year\n",
       "33        Australia  2023\n",
       "34        Australia  2024\n",
       "68           Brazil  2023\n",
       "69           Brazil  2024\n",
       "103           China  2023\n",
       "104           China  2024\n",
       "138         Germany  2023\n",
       "139         Germany  2024\n",
       "173           India  2023\n",
       "174           India  2024\n",
       "208           Japan  2023\n",
       "209           Japan  2024\n",
       "243          Russia  2023\n",
       "244          Russia  2024\n",
       "278    South Africa  2023\n",
       "279    South Africa  2024\n",
       "313  United Kingdom  2023\n",
       "314  United Kingdom  2024\n",
       "348   United States  2023\n",
       "349   United States  2024"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "base[\"ghg_intensity\"] = np.where(\n",
    "    base[\"gdp\"].notna() & (base[\"gdp\"] > 0),\n",
    "    base[\"total_ghg\"] / base[\"gdp\"],\n",
    "    np.nan,\n",
    ")\n",
    "\n",
    "missing_intensity = base[base[\"ghg_intensity\"].isna()][[\"country\", \"year\"]]\n",
    "print(f\"Country-years where ghg_intensity could not be computed (missing/zero GDP): {len(missing_intensity)}\")\n",
    "missing_intensity"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c3c7ef82",
   "metadata": {},
   "source": [
    "<a id=\"w2-4\"></a>\n",
    "### 2.4 Growth Rate Features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6e0a752e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.719530Z",
     "iopub.status.busy": "2026-07-29T14:01:50.719407Z",
     "iopub.status.idle": "2026-07-29T14:01:50.726271Z",
     "shell.execute_reply": "2026-07-29T14:01:50.725887Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Top 5 countries by highest average annual CO2 growth rate since 1990:\n",
      "country\n",
      "India           5.21\n",
      "China           4.91\n",
      "Brazil          2.46\n",
      "South Africa    1.13\n",
      "Australia       0.99\n",
      "Name: co2_yoy_pct_change, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "base[\"co2_yoy_change\"] = base.groupby(\"country\")[\"co2\"].diff()\n",
    "base[\"co2_yoy_pct_change\"] = base.groupby(\"country\")[\"co2\"].pct_change() * 100\n",
    "\n",
    "avg_growth = (\n",
    "    base[base[\"year\"] >= 1991]\n",
    "    .groupby(\"country\")[\"co2_yoy_pct_change\"]\n",
    "    .mean()\n",
    "    .sort_values(ascending=False)\n",
    ")\n",
    "\n",
    "print(\"Top 5 countries by highest average annual CO2 growth rate since 1990:\")\n",
    "print(avg_growth.head(5).round(2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f41c866",
   "metadata": {},
   "source": [
    "Next, identify the countries with the largest absolute CO2 reduction since 1990 (a separate question\n",
    "from \"highest average growth rate,\" since a country can grow for years and still end up lower than it\n",
    "started)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "21b93ecc",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.727698Z",
     "iopub.status.busy": "2026-07-29T14:01:50.727568Z",
     "iopub.status.idle": "2026-07-29T14:01:50.733577Z",
     "shell.execute_reply": "2026-07-29T14:01:50.733101Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Top 5 countries by largest absolute CO2 reduction since 1990 (1990 level minus 2024 level, Mt):\n",
      "country\n",
      "Russia            755.8\n",
      "Germany           482.5\n",
      "United Kingdom    289.0\n",
      "United States     227.6\n",
      "Japan             193.0\n",
      "Name: co2, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "co2_1990 = base[base[\"year\"] == 1990].set_index(\"country\")[\"co2\"]\n",
    "co2_latest = base[base[\"year\"] == base[\"year\"].max()].set_index(\"country\")[\"co2\"]\n",
    "total_reduction = (co2_1990 - co2_latest).sort_values(ascending=False)\n",
    "\n",
    "print(f\"Top 5 countries by largest absolute CO2 reduction since 1990 (1990 level minus \"\n",
    "      f\"{base['year'].max()} level, Mt):\")\n",
    "print(total_reduction.head(5).round(1))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "52d36a5f",
   "metadata": {},
   "source": [
    "<a id=\"w2-5\"></a>\n",
    "### 2.5 Final Feature Dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b22c0756",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.734787Z",
     "iopub.status.busy": "2026-07-29T14:01:50.734665Z",
     "iopub.status.idle": "2026-07-29T14:01:50.749511Z",
     "shell.execute_reply": "2026-07-29T14:01:50.749031Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Saved ../data/ghg_features.csv with shape (350, 10)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_per_capita</th>\n",
       "      <th>co2_5yr_rolling_mean</th>\n",
       "      <th>co2_lag1</th>\n",
       "      <th>co2_lag2</th>\n",
       "      <th>co2_lag3</th>\n",
       "      <th>co2_yoy_pct_change</th>\n",
       "      <th>ghg_intensity</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1990</td>\n",
       "      <td>278.061</td>\n",
       "      <td>16.236</td>\n",
       "      <td>278.061000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.160174e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1991</td>\n",
       "      <td>279.437</td>\n",
       "      <td>16.103</td>\n",
       "      <td>278.749000</td>\n",
       "      <td>278.061</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.494855</td>\n",
       "      <td>1.132718e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1992</td>\n",
       "      <td>284.433</td>\n",
       "      <td>16.208</td>\n",
       "      <td>280.643667</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.787881</td>\n",
       "      <td>1.188721e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1993</td>\n",
       "      <td>288.780</td>\n",
       "      <td>16.294</td>\n",
       "      <td>282.677750</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "      <td>1.528304</td>\n",
       "      <td>1.157801e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1994</td>\n",
       "      <td>293.613</td>\n",
       "      <td>16.405</td>\n",
       "      <td>284.864800</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>1.673592</td>\n",
       "      <td>1.049415e-09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     country  year      co2  co2_per_capita  co2_5yr_rolling_mean  co2_lag1  \\\n",
       "0  Australia  1990  278.061          16.236            278.061000       NaN   \n",
       "1  Australia  1991  279.437          16.103            278.749000   278.061   \n",
       "2  Australia  1992  284.433          16.208            280.643667   279.437   \n",
       "3  Australia  1993  288.780          16.294            282.677750   284.433   \n",
       "4  Australia  1994  293.613          16.405            284.864800   288.780   \n",
       "\n",
       "   co2_lag2  co2_lag3  co2_yoy_pct_change  ghg_intensity  \n",
       "0       NaN       NaN                 NaN   1.160174e-09  \n",
       "1       NaN       NaN            0.494855   1.132718e-09  \n",
       "2   278.061       NaN            1.787881   1.188721e-09  \n",
       "3   279.437   278.061            1.528304   1.157801e-09  \n",
       "4   284.433   279.437            1.673592   1.049415e-09  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_cols = [\n",
    "    \"country\", \"year\", \"co2\", \"co2_per_capita\", \"co2_5yr_rolling_mean\",\n",
    "    \"co2_lag1\", \"co2_lag2\", \"co2_lag3\", \"co2_yoy_pct_change\", \"ghg_intensity\",\n",
    "]\n",
    "features_df = base[feature_cols].copy()\n",
    "\n",
    "features_df.to_csv(\"../data/ghg_features.csv\", index=False)\n",
    "print(f\"Saved ../data/ghg_features.csv with shape {features_df.shape}\")\n",
    "features_df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "32d8be81",
   "metadata": {},
   "source": [
    "<a id=\"week3\"></a>\n",
    "## Week 3: Baseline ML Models — Regression\n",
    "\n",
    "*Learning objective: train, evaluate, and compare supervised regression models to predict future\n",
    "CO2 emissions; understand model evaluation metrics.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "13caaa4b",
   "metadata": {},
   "source": [
    "<a id=\"w3-1\"></a>\n",
    "### 3.1 Problem Framing\n",
    "\n",
    "**Prediction task:** given a feature vector **X** describing country *C* in year *Y*, predict\n",
    "CO<sub>2</sub> emissions for year *Y+1* (`target_co2_next`).\n",
    "\n",
    "**Target variable:** `co2` shifted forward by one year within each country (`target_co2_next`).\n",
    "\n",
    "**Input features** (from the Week 2 feature set): `years_since_1990`, `co2`, `co2_per_capita`,\n",
    "`co2_5yr_rolling_mean`, `co2_lag1`, `co2_lag2`, `co2_lag3`.\n",
    "\n",
    "**Note on training strategy:** models in this week use two different training approaches — Linear\n",
    "Regression is trained *per country* (works reliably with ~30 rows per country), while Random Forest is\n",
    "trained on the *pooled* dataset of all 10 countries (~300 training rows) to avoid overfitting from\n",
    "small per-country sample sizes; both are evaluated per country for direct comparison.\n",
    "\n",
    "**Why a supervised regression approach?** Framing the forecasting problem as \"predict next year from\n",
    "this year's features\" turns it into a standard tabular supervised-learning problem, which lets us use\n",
    "well-understood, fast-to-train models (linear regression, tree ensembles) as an interpretable baseline\n",
    "before moving to a dedicated time-series model in Week 4."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "87304131",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.750863Z",
     "iopub.status.busy": "2026-07-29T14:01:50.750742Z",
     "iopub.status.idle": "2026-07-29T14:01:50.762637Z",
     "shell.execute_reply": "2026-07-29T14:01:50.762112Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Modelling rows: 310  |  Year range: 1993-2023\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>years_since_1990</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_per_capita</th>\n",
       "      <th>co2_5yr_rolling_mean</th>\n",
       "      <th>co2_lag1</th>\n",
       "      <th>co2_lag2</th>\n",
       "      <th>co2_lag3</th>\n",
       "      <th>target_co2_next</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1993</td>\n",
       "      <td>3</td>\n",
       "      <td>288.780</td>\n",
       "      <td>16.294</td>\n",
       "      <td>282.67775</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>278.061</td>\n",
       "      <td>293.613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1994</td>\n",
       "      <td>4</td>\n",
       "      <td>293.613</td>\n",
       "      <td>16.405</td>\n",
       "      <td>284.86480</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "      <td>279.437</td>\n",
       "      <td>304.962</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1995</td>\n",
       "      <td>5</td>\n",
       "      <td>304.962</td>\n",
       "      <td>16.853</td>\n",
       "      <td>290.24500</td>\n",
       "      <td>293.613</td>\n",
       "      <td>288.780</td>\n",
       "      <td>284.433</td>\n",
       "      <td>311.851</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1996</td>\n",
       "      <td>6</td>\n",
       "      <td>311.851</td>\n",
       "      <td>17.036</td>\n",
       "      <td>296.72780</td>\n",
       "      <td>304.962</td>\n",
       "      <td>293.613</td>\n",
       "      <td>288.780</td>\n",
       "      <td>320.243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1997</td>\n",
       "      <td>7</td>\n",
       "      <td>320.243</td>\n",
       "      <td>17.306</td>\n",
       "      <td>303.88980</td>\n",
       "      <td>311.851</td>\n",
       "      <td>304.962</td>\n",
       "      <td>293.613</td>\n",
       "      <td>334.038</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     country  year  years_since_1990      co2  co2_per_capita  \\\n",
       "0  Australia  1993                 3  288.780          16.294   \n",
       "1  Australia  1994                 4  293.613          16.405   \n",
       "2  Australia  1995                 5  304.962          16.853   \n",
       "3  Australia  1996                 6  311.851          17.036   \n",
       "4  Australia  1997                 7  320.243          17.306   \n",
       "\n",
       "   co2_5yr_rolling_mean  co2_lag1  co2_lag2  co2_lag3  target_co2_next  \n",
       "0             282.67775   284.433   279.437   278.061          293.613  \n",
       "1             284.86480   288.780   284.433   279.437          304.962  \n",
       "2             290.24500   293.613   288.780   284.433          311.851  \n",
       "3             296.72780   304.962   293.613   288.780          320.243  \n",
       "4             303.88980   311.851   304.962   293.613          334.038  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model_df = base.copy()\n",
    "model_df[\"target_co2_next\"] = model_df.groupby(\"country\")[\"co2\"].shift(-1)\n",
    "\n",
    "feature_names = [\n",
    "    \"years_since_1990\", \"co2\", \"co2_per_capita\",\n",
    "    \"co2_5yr_rolling_mean\", \"co2_lag1\", \"co2_lag2\", \"co2_lag3\",\n",
    "]\n",
    "\n",
    "# Drop rows without a full lag history or without a next-year target to predict\n",
    "model_df = model_df.dropna(subset=feature_names + [\"target_co2_next\"]).reset_index(drop=True)\n",
    "print(f\"Modelling rows: {len(model_df)}  |  Year range: {model_df['year'].min()}-{model_df['year'].max()}\")\n",
    "model_df[[\"country\", \"year\"] + feature_names + [\"target_co2_next\"]].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "10c6086e",
   "metadata": {},
   "source": [
    "<a id=\"w3-2\"></a>\n",
    "### 3.2 Train-Test Split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "71165f82",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.764017Z",
     "iopub.status.busy": "2026-07-29T14:01:50.763872Z",
     "iopub.status.idle": "2026-07-29T14:01:50.771760Z",
     "shell.execute_reply": "2026-07-29T14:01:50.771135Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>train_rows</th>\n",
       "      <th>test_rows</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>country</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Australia</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Brazil</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>China</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Germany</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>India</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Japan</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Russia</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>South Africa</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United Kingdom</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United States</th>\n",
       "      <td>26</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                train_rows  test_rows\n",
       "country                              \n",
       "Australia               26          5\n",
       "Brazil                  26          5\n",
       "China                   26          5\n",
       "Germany                 26          5\n",
       "India                   26          5\n",
       "Japan                   26          5\n",
       "Russia                  26          5\n",
       "South Africa            26          5\n",
       "United Kingdom          26          5\n",
       "United States           26          5"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train = model_df[model_df[\"year\"] <= 2018].copy()\n",
    "test = model_df[model_df[\"year\"] >= 2019].copy()\n",
    "\n",
    "split_counts = pd.DataFrame({\n",
    "    \"train_rows\": train.groupby(\"country\").size(),\n",
    "    \"test_rows\": test.groupby(\"country\").size(),\n",
    "}).fillna(0).astype(int)\n",
    "split_counts"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb08af04",
   "metadata": {},
   "source": [
    "*The 2019–2023 test window is deliberately chosen to include the COVID-19 pandemic emissions dip\n",
    "(2020) and subsequent recovery — a useful real-world stress test for model robustness.*\n",
    "\n",
    "**Why temporal splitting, not random splitting?** Emissions data is a time series with strong\n",
    "year-to-year autocorrelation and a trend. A random train/test split would let the model \"see\" data\n",
    "from years surrounding a test point (e.g. train on 2021, test on 2020), which leaks future information\n",
    "into training and produces unrealistically optimistic accuracy. A temporal split — train on the past\n",
    "(1990–2018), test on the future (2019 onward) — mimics the real deployment scenario of forecasting\n",
    "years that have not happened yet, and is standard practice for any time-series prediction task."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c02433c",
   "metadata": {},
   "source": [
    "<a id=\"w3-3\"></a>\n",
    "### 3.3 Naive Baseline Model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "2d34de14",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.773191Z",
     "iopub.status.busy": "2026-07-29T14:01:50.773050Z",
     "iopub.status.idle": "2026-07-29T14:01:50.791722Z",
     "shell.execute_reply": "2026-07-29T14:01:50.791119Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>baseline_mae</th>\n",
       "      <th>baseline_rmse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>315.1044</td>\n",
       "      <td>344.121882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>212.5380</td>\n",
       "      <td>292.332458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>191.8378</td>\n",
       "      <td>197.188147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>44.2358</td>\n",
       "      <td>50.307134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>36.5260</td>\n",
       "      <td>39.830915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>39.5944</td>\n",
       "      <td>46.431112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>19.7412</td>\n",
       "      <td>26.352645</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>18.8426</td>\n",
       "      <td>23.468566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>12.2652</td>\n",
       "      <td>17.077892</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>6.7002</td>\n",
       "      <td>8.887581</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country  baseline_mae  baseline_rmse\n",
       "0           China      315.1044     344.121882\n",
       "1   United States      212.5380     292.332458\n",
       "2           India      191.8378     197.188147\n",
       "3          Russia       44.2358      50.307134\n",
       "4           Japan       36.5260      39.830915\n",
       "5         Germany       39.5944      46.431112\n",
       "6          Brazil       19.7412      26.352645\n",
       "7  United Kingdom       18.8426      23.468566\n",
       "8    South Africa       12.2652      17.077892\n",
       "9       Australia        6.7002       8.887581"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Naive baseline: predict next year's CO2 = this year's CO2 (no-change model)\n",
    "test_baseline = test.copy()\n",
    "test_baseline[\"pred_naive\"] = test_baseline[\"co2\"]\n",
    "\n",
    "baseline_results = []\n",
    "for country in COUNTRIES:\n",
    "    t = test_baseline[test_baseline[\"country\"] == country]\n",
    "    if t.empty:\n",
    "        continue\n",
    "    mae = mean_absolute_error(t[\"target_co2_next\"], t[\"pred_naive\"])\n",
    "    rmse = mean_squared_error(t[\"target_co2_next\"], t[\"pred_naive\"]) ** 0.5\n",
    "    baseline_results.append({\"country\": country, \"baseline_mae\": mae, \"baseline_rmse\": rmse})\n",
    "\n",
    "baseline_df = pd.DataFrame(baseline_results)\n",
    "baseline_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "52d7b581",
   "metadata": {},
   "source": [
    "Visualise the naive baseline's predictions against actuals for three representative countries\n",
    "(a large steady emitter, a plateaued emitter, and a declining emitter)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "47a4828a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.793064Z",
     "iopub.status.busy": "2026-07-29T14:01:50.792929Z",
     "iopub.status.idle": "2026-07-29T14:01:50.823562Z",
     "shell.execute_reply": "2026-07-29T14:01:50.822922Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "China actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "nMQgsEJIxUDZzvdTMwrGQJZDi2zn38ZA1XjpJgHGx0D6fmq8hADIQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "line": {
          "color": "crimson",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "China naive pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "uB6F68HsxECcxCCwQkjFQNnO91MzCsZAlkOLbOffxkDVeOkmAcbHQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "United States actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x2",
         "y": {
          "bdata": "YhBYOfRRskDb+X5qHJyzQEoMAitnv7NAeekmMWg2s0CF61G4HiizQA==",
          "dtype": "f8"
         },
         "yaxis": "y2"
        },
        {
         "line": {
          "color": "crimson",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "United States naive pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x2",
         "y": {
          "bdata": "9P3UeOlztEBiEFg59FGyQNv5fmocnLNASgwCK2e/s0B56SYxaDazQA==",
          "dtype": "f8"
         },
         "yaxis": "y2"
        },
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "Germany actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x3",
         "y": {
          "bdata": "I9v5fmo5hEBEi2zn+y+FQDm0yHa+3oRA46WbxCCOgkBkO99PjeKBQA==",
          "dtype": "f8"
         },
         "yaxis": "y3"
        },
        {
         "line": {
          "color": "crimson",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "Germany naive pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x3",
         "y": {
          "bdata": "1XjpJjElhkAj2/l+ajmEQESLbOf7L4VAObTIdr7ehEDjpZvEII6CQA==",
          "dtype": "f8"
         },
         "yaxis": "y3"
        }
       ],
       "layout": {
        "annotations": [
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "China",
          "x": 0.14444444444444446,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "United States",
          "x": 0.5,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "Germany",
          "x": 0.8555555555555556,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         }
        ],
        "height": 400,
        "showlegend": false,
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Naive Baseline: Actual vs Predicted CO2 (Test Set)"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          0.2888888888888889
         ]
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.35555555555555557,
          0.6444444444444445
         ]
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0.7111111111111111,
          1.0
         ]
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ]
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0.0,
          1.0
         ]
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0.0,
          1.0
         ]
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = make_subplots(rows=1, cols=3, subplot_titles=[\"China\", \"United States\", \"Germany\"])\n",
    "for i, country in enumerate([\"China\", \"United States\", \"Germany\"], start=1):\n",
    "    t = test_baseline[test_baseline[\"country\"] == country].sort_values(\"year\")\n",
    "    fig.add_trace(go.Scatter(x=t[\"year\"] + 1, y=t[\"target_co2_next\"], name=f\"{country} actual\",\n",
    "                              mode=\"lines+markers\", line=dict(color=\"black\")), row=1, col=i)\n",
    "    fig.add_trace(go.Scatter(x=t[\"year\"] + 1, y=t[\"pred_naive\"], name=f\"{country} naive pred\",\n",
    "                              mode=\"lines+markers\", line=dict(color=\"crimson\", dash=\"dash\")), row=1, col=i)\n",
    "fig.update_layout(title=\"Naive Baseline: Actual vs Predicted CO2 (Test Set)\", template=\"plotly_white\",\n",
    "                   showlegend=False, height=400)\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8bc52387",
   "metadata": {},
   "source": [
    "<a id=\"w3-4\"></a>\n",
    "### 3.4 Linear Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "50404edf",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.825509Z",
     "iopub.status.busy": "2026-07-29T14:01:50.825263Z",
     "iopub.status.idle": "2026-07-29T14:01:50.883803Z",
     "shell.execute_reply": "2026-07-29T14:01:50.883257Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>lr_mae</th>\n",
       "      <th>lr_rmse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>209.637912</td>\n",
       "      <td>217.080635</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>493.508312</td>\n",
       "      <td>507.528564</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>164.681580</td>\n",
       "      <td>206.598066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>28.142367</td>\n",
       "      <td>33.114854</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>73.832138</td>\n",
       "      <td>78.263640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>93.511170</td>\n",
       "      <td>104.036157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>61.668605</td>\n",
       "      <td>68.483950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>20.957635</td>\n",
       "      <td>23.563674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>32.178236</td>\n",
       "      <td>32.896253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>19.935511</td>\n",
       "      <td>20.608881</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country      lr_mae     lr_rmse\n",
       "0           China  209.637912  217.080635\n",
       "1   United States  493.508312  507.528564\n",
       "2           India  164.681580  206.598066\n",
       "3          Russia   28.142367   33.114854\n",
       "4           Japan   73.832138   78.263640\n",
       "5         Germany   93.511170  104.036157\n",
       "6          Brazil   61.668605   68.483950\n",
       "7  United Kingdom   20.957635   23.563674\n",
       "8    South Africa   32.178236   32.896253\n",
       "9       Australia   19.935511   20.608881"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr_models = {}\n",
    "lr_results = []\n",
    "lr_test_preds = []\n",
    "\n",
    "for country in COUNTRIES:\n",
    "    train_c = train[train[\"country\"] == country]\n",
    "    test_c = test[test[\"country\"] == country]\n",
    "    if len(train_c) < 3 or test_c.empty:\n",
    "        continue\n",
    "\n",
    "    X_train, y_train = train_c[feature_names], train_c[\"target_co2_next\"]\n",
    "    X_test, y_test = test_c[feature_names], test_c[\"target_co2_next\"]\n",
    "\n",
    "    lr = LinearRegression().fit(X_train, y_train)\n",
    "    preds = lr.predict(X_test)\n",
    "\n",
    "    mae = mean_absolute_error(y_test, preds)\n",
    "    rmse = mean_squared_error(y_test, preds) ** 0.5\n",
    "\n",
    "    lr_models[country] = lr\n",
    "    lr_results.append({\"country\": country, \"lr_mae\": mae, \"lr_rmse\": rmse})\n",
    "    lr_test_preds.append(test_c.assign(pred_lr=preds))\n",
    "\n",
    "lr_df = pd.DataFrame(lr_results)\n",
    "lr_test_preds_df = pd.concat(lr_test_preds, ignore_index=True)\n",
    "lr_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1875b6f",
   "metadata": {},
   "source": [
    "Visualise the Linear Regression predictions against actuals for the same three countries, for a\n",
    "direct comparison with the naive baseline chart above."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "015ae9e5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.885237Z",
     "iopub.status.busy": "2026-07-29T14:01:50.885117Z",
     "iopub.status.idle": "2026-07-29T14:01:50.912566Z",
     "shell.execute_reply": "2026-07-29T14:01:50.912143Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "China actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "nMQgsEJIxUDZzvdTMwrGQJZDi2zn38ZA1XjpJgHGx0D6fmq8hADIQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "line": {
          "color": "royalblue",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "China LR pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "frgmnzaAxUCmK2qgj4jFQFoaEI5bgsZA1EZtbOZVx0DArU3EXoXIQA==",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "United States actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x2",
         "y": {
          "bdata": "YhBYOfRRskDb+X5qHJyzQEoMAitnv7NAeekmMWg2s0CF61G4HiizQA==",
          "dtype": "f8"
         },
         "yaxis": "y2"
        },
        {
         "line": {
          "color": "royalblue",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "United States LR pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x2",
         "y": {
          "bdata": "D6c0eQKUtEAgIP719OG0QKhCVNudmbVAmmEd3hXetEBjJlwz3sG1QA==",
          "dtype": "f8"
         },
         "yaxis": "y2"
        },
        {
         "line": {
          "color": "black"
         },
         "mode": "lines+markers",
         "name": "Germany actual",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x3",
         "y": {
          "bdata": "I9v5fmo5hEBEi2zn+y+FQDm0yHa+3oRA46WbxCCOgkBkO99PjeKBQA==",
          "dtype": "f8"
         },
         "yaxis": "y3"
        },
        {
         "line": {
          "color": "royalblue",
          "dash": "dash"
         },
         "mode": "lines+markers",
         "name": "Germany LR pred",
         "type": "scatter",
         "x": {
          "bdata": "5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "xaxis": "x3",
         "y": {
          "bdata": "6H2+puXThkDydT9HYHGGQFIDdEEOdoZAOJ1zvdMgh0AgjQxnHXmGQA==",
          "dtype": "f8"
         },
         "yaxis": "y3"
        }
       ],
       "layout": {
        "annotations": [
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "China",
          "x": 0.14444444444444446,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "United States",
          "x": 0.5,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "Germany",
          "x": 0.8555555555555556,
          "xanchor": "center",
          "xref": "paper",
          "y": 1.0,
          "yanchor": "bottom",
          "yref": "paper"
         }
        ],
        "height": 400,
        "showlegend": false,
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Linear Regression: Actual vs Predicted CO2 (Test Set)"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          0.2888888888888889
         ]
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.35555555555555557,
          0.6444444444444445
         ]
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0.7111111111111111,
          1.0
         ]
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ]
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0.0,
          1.0
         ]
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0.0,
          1.0
         ]
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = make_subplots(rows=1, cols=3, subplot_titles=[\"China\", \"United States\", \"Germany\"])\n",
    "for i, country in enumerate([\"China\", \"United States\", \"Germany\"], start=1):\n",
    "    t = lr_test_preds_df[lr_test_preds_df[\"country\"] == country].sort_values(\"year\")\n",
    "    fig.add_trace(go.Scatter(x=t[\"year\"] + 1, y=t[\"target_co2_next\"], name=f\"{country} actual\",\n",
    "                              mode=\"lines+markers\", line=dict(color=\"black\")), row=1, col=i)\n",
    "    fig.add_trace(go.Scatter(x=t[\"year\"] + 1, y=t[\"pred_lr\"], name=f\"{country} LR pred\",\n",
    "                              mode=\"lines+markers\", line=dict(color=\"royalblue\", dash=\"dash\")), row=1, col=i)\n",
    "fig.update_layout(title=\"Linear Regression: Actual vs Predicted CO2 (Test Set)\", template=\"plotly_white\",\n",
    "                   showlegend=False, height=400)\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "79995c08",
   "metadata": {},
   "source": [
    "Inspect the fitted coefficients for each country's Linear Regression model to see which features\n",
    "drive its predictions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "1b8de453",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.914263Z",
     "iopub.status.busy": "2026-07-29T14:01:50.914116Z",
     "iopub.status.idle": "2026-07-29T14:01:50.925152Z",
     "shell.execute_reply": "2026-07-29T14:01:50.924663Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>years_since_1990</th>\n",
       "      <th>co2</th>\n",
       "      <th>co2_per_capita</th>\n",
       "      <th>co2_5yr_rolling_mean</th>\n",
       "      <th>co2_lag1</th>\n",
       "      <th>co2_lag2</th>\n",
       "      <th>co2_lag3</th>\n",
       "      <th>intercept</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>China</th>\n",
       "      <td>90.999</td>\n",
       "      <td>-0.749</td>\n",
       "      <td>2402.902</td>\n",
       "      <td>1.696</td>\n",
       "      <td>-0.935</td>\n",
       "      <td>-0.066</td>\n",
       "      <td>-0.794</td>\n",
       "      <td>-798.415</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United States</th>\n",
       "      <td>162.268</td>\n",
       "      <td>-2.677</td>\n",
       "      <td>978.830</td>\n",
       "      <td>-0.057</td>\n",
       "      <td>-0.083</td>\n",
       "      <td>0.501</td>\n",
       "      <td>-0.008</td>\n",
       "      <td>-2407.633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>India</th>\n",
       "      <td>2.340</td>\n",
       "      <td>2.617</td>\n",
       "      <td>-2047.438</td>\n",
       "      <td>-2.447</td>\n",
       "      <td>1.299</td>\n",
       "      <td>0.311</td>\n",
       "      <td>0.368</td>\n",
       "      <td>712.838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Russia</th>\n",
       "      <td>6.775</td>\n",
       "      <td>-1.385</td>\n",
       "      <td>233.877</td>\n",
       "      <td>0.286</td>\n",
       "      <td>-0.256</td>\n",
       "      <td>-0.053</td>\n",
       "      <td>0.105</td>\n",
       "      <td>994.663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Japan</th>\n",
       "      <td>-3.422</td>\n",
       "      <td>4.106</td>\n",
       "      <td>-432.023</td>\n",
       "      <td>0.149</td>\n",
       "      <td>-0.512</td>\n",
       "      <td>0.130</td>\n",
       "      <td>-0.378</td>\n",
       "      <td>1167.974</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Germany</th>\n",
       "      <td>-8.980</td>\n",
       "      <td>-0.404</td>\n",
       "      <td>24.067</td>\n",
       "      <td>0.935</td>\n",
       "      <td>0.001</td>\n",
       "      <td>-0.494</td>\n",
       "      <td>-0.428</td>\n",
       "      <td>1081.208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Brazil</th>\n",
       "      <td>10.864</td>\n",
       "      <td>0.984</td>\n",
       "      <td>9.444</td>\n",
       "      <td>-1.791</td>\n",
       "      <td>0.340</td>\n",
       "      <td>0.374</td>\n",
       "      <td>0.089</td>\n",
       "      <td>190.422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United Kingdom</th>\n",
       "      <td>9.412</td>\n",
       "      <td>-3.938</td>\n",
       "      <td>231.221</td>\n",
       "      <td>2.375</td>\n",
       "      <td>-0.060</td>\n",
       "      <td>-0.540</td>\n",
       "      <td>-0.541</td>\n",
       "      <td>-214.535</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>South Africa</th>\n",
       "      <td>16.739</td>\n",
       "      <td>-2.119</td>\n",
       "      <td>138.949</td>\n",
       "      <td>-0.955</td>\n",
       "      <td>0.094</td>\n",
       "      <td>0.275</td>\n",
       "      <td>0.241</td>\n",
       "      <td>39.659</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Australia</th>\n",
       "      <td>5.287</td>\n",
       "      <td>0.132</td>\n",
       "      <td>16.834</td>\n",
       "      <td>1.305</td>\n",
       "      <td>-1.143</td>\n",
       "      <td>0.476</td>\n",
       "      <td>-0.880</td>\n",
       "      <td>34.541</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                years_since_1990    co2  co2_per_capita  co2_5yr_rolling_mean  \\\n",
       "China                     90.999 -0.749        2402.902                 1.696   \n",
       "United States            162.268 -2.677         978.830                -0.057   \n",
       "India                      2.340  2.617       -2047.438                -2.447   \n",
       "Russia                     6.775 -1.385         233.877                 0.286   \n",
       "Japan                     -3.422  4.106        -432.023                 0.149   \n",
       "Germany                   -8.980 -0.404          24.067                 0.935   \n",
       "Brazil                    10.864  0.984           9.444                -1.791   \n",
       "United Kingdom             9.412 -3.938         231.221                 2.375   \n",
       "South Africa              16.739 -2.119         138.949                -0.955   \n",
       "Australia                  5.287  0.132          16.834                 1.305   \n",
       "\n",
       "                co2_lag1  co2_lag2  co2_lag3  intercept  \n",
       "China             -0.935    -0.066    -0.794   -798.415  \n",
       "United States     -0.083     0.501    -0.008  -2407.633  \n",
       "India              1.299     0.311     0.368    712.838  \n",
       "Russia            -0.256    -0.053     0.105    994.663  \n",
       "Japan             -0.512     0.130    -0.378   1167.974  \n",
       "Germany            0.001    -0.494    -0.428   1081.208  \n",
       "Brazil             0.340     0.374     0.089    190.422  \n",
       "United Kingdom    -0.060    -0.540    -0.541   -214.535  \n",
       "South Africa       0.094     0.275     0.241     39.659  \n",
       "Australia         -1.143     0.476    -0.880     34.541  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "coef_table = pd.DataFrame({\n",
    "    country: model.coef_ for country, model in lr_models.items()\n",
    "}, index=feature_names).T\n",
    "coef_table[\"intercept\"] = [model.intercept_ for model in lr_models.values()]\n",
    "coef_table.round(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ecdee770",
   "metadata": {},
   "source": [
    "**Interpreting the coefficients.** Across almost every country, `co2` (this year's level) and\n",
    "`co2_lag1` carry by far the largest coefficient magnitudes, confirming that next year's emissions are\n",
    "overwhelmingly driven by the current level — emissions move gradually, not erratically. The\n",
    "`co2_5yr_rolling_mean` and `co2_per_capita` terms tend to have smaller, sometimes offsetting\n",
    "coefficients due to collinearity with `co2` itself (per-capita is a scaled version of the same signal,\n",
    "and the rolling mean is a smoothed version of recent `co2` values). `years_since_1990` typically\n",
    "contributes a small, steady trend term capturing the country's long-run growth or decline that isn't\n",
    "already captured by the lag features."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c3b8ea10",
   "metadata": {},
   "source": [
    "<a id=\"w3-5\"></a>\n",
    "### 3.5 Random Forest Regressor"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "53d9231b",
   "metadata": {},
   "source": [
    "**Mandatory limitations note (read before the training code below).**\n",
    "\n",
    "1. **Why ~30 rows per country is insufficient for a per-country Random Forest.** Each of our 10\n",
    "   countries has only around 30 annual observations in the training window. A Random Forest relies on\n",
    "   bootstrap-resampling many trees from the training set and calculating feature importance from how\n",
    "   much each split reduces error; with only ~30 rows, bootstrap samples are highly repetitive, trees\n",
    "   overfit to noise in individual years, and the resulting feature importances are unstable — small\n",
    "   changes in `random_state` can reorder which feature looks \"most important.\"\n",
    "2. **What pooling achieves, and its trade-offs.** Training a single Random Forest on all 10 countries\n",
    "   pooled together (~300 rows) gives the model enough data to find genuinely generalisable splits, and\n",
    "   a `country_encoded` feature lets it still distinguish between countries operating at very different\n",
    "   emissions scales. The trade-off is that the pooled model learns *cross-country* patterns and cannot\n",
    "   capture dynamics that are purely idiosyncratic to one country's history.\n",
    "3. **The key teaching point.** Model complexity must match data availability. A simple model\n",
    "   (Linear Regression) trained on a small, well-structured per-country sample can outperform a complex\n",
    "   model (Random Forest) that lacks enough training examples to use its extra flexibility reliably —\n",
    "   more parameters are not automatically better."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "7b1866fe",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:50.926408Z",
     "iopub.status.busy": "2026-07-29T14:01:50.926280Z",
     "iopub.status.idle": "2026-07-29T14:01:51.038273Z",
     "shell.execute_reply": "2026-07-29T14:01:51.037598Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Random Forest trained on 260 pooled rows across 10 countries\n"
     ]
    }
   ],
   "source": [
    "train_pool = train.copy()\n",
    "test_pool = test.copy()\n",
    "\n",
    "country_encoder = LabelEncoder().fit(model_df[\"country\"])\n",
    "train_pool[\"country_encoded\"] = country_encoder.transform(train_pool[\"country\"])\n",
    "test_pool[\"country_encoded\"] = country_encoder.transform(test_pool[\"country\"])\n",
    "\n",
    "rf_feature_names = feature_names + [\"country_encoded\"]\n",
    "\n",
    "rf = RandomForestRegressor(n_estimators=100, random_state=42)\n",
    "rf.fit(train_pool[rf_feature_names], train_pool[\"target_co2_next\"])\n",
    "\n",
    "print(f\"Random Forest trained on {len(train_pool)} pooled rows across {train_pool['country'].nunique()} countries\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6a5d375",
   "metadata": {},
   "source": [
    "Evaluate the single pooled Random Forest model on each country's own test set, so its per-country\n",
    "accuracy can be compared directly against the per-country Linear Regression results above."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "76715680",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.039852Z",
     "iopub.status.busy": "2026-07-29T14:01:51.039708Z",
     "iopub.status.idle": "2026-07-29T14:01:51.134330Z",
     "shell.execute_reply": "2026-07-29T14:01:51.133716Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>rf_mae</th>\n",
       "      <th>rf_rmse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>1189.227982</td>\n",
       "      <td>1295.894913</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>366.323132</td>\n",
       "      <td>384.400753</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>158.783050</td>\n",
       "      <td>180.747084</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>35.200624</td>\n",
       "      <td>39.562768</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>102.989028</td>\n",
       "      <td>105.427386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>88.092948</td>\n",
       "      <td>95.586982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>17.306152</td>\n",
       "      <td>21.627490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>41.429904</td>\n",
       "      <td>42.282855</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>14.727604</td>\n",
       "      <td>17.676925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>10.217262</td>\n",
       "      <td>10.912014</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country       rf_mae      rf_rmse\n",
       "0           China  1189.227982  1295.894913\n",
       "1   United States   366.323132   384.400753\n",
       "2           India   158.783050   180.747084\n",
       "3          Russia    35.200624    39.562768\n",
       "4           Japan   102.989028   105.427386\n",
       "5         Germany    88.092948    95.586982\n",
       "6          Brazil    17.306152    21.627490\n",
       "7  United Kingdom    41.429904    42.282855\n",
       "8    South Africa    14.727604    17.676925\n",
       "9       Australia    10.217262    10.912014"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rf_results = []\n",
    "rf_test_preds = []\n",
    "\n",
    "for country in COUNTRIES:\n",
    "    test_c = test_pool[test_pool[\"country\"] == country]\n",
    "    if test_c.empty:\n",
    "        continue\n",
    "    preds = rf.predict(test_c[rf_feature_names])\n",
    "    mae = mean_absolute_error(test_c[\"target_co2_next\"], preds)\n",
    "    rmse = mean_squared_error(test_c[\"target_co2_next\"], preds) ** 0.5\n",
    "    rf_results.append({\"country\": country, \"rf_mae\": mae, \"rf_rmse\": rmse})\n",
    "    rf_test_preds.append(test_c.assign(pred_rf=preds))\n",
    "\n",
    "rf_df = pd.DataFrame(rf_results)\n",
    "rf_test_preds_df = pd.concat(rf_test_preds, ignore_index=True)\n",
    "rf_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7e935791",
   "metadata": {},
   "source": [
    "Visualise which features the pooled Random Forest relies on most, as a single chart for the whole\n",
    "model (not per country, since it is one model shared across all 10 countries)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "fc82d18f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.135794Z",
     "iopub.status.busy": "2026-07-29T14:01:51.135657Z",
     "iopub.status.idle": "2026-07-29T14:01:51.173816Z",
     "shell.execute_reply": "2026-07-29T14:01:51.173142Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "Importance=%{x}<br>Feature=%{y}<extra></extra>",
         "legendgroup": "",
         "marker": {
          "color": "#2ca02c",
          "pattern": {
           "shape": ""
          }
         },
         "name": "",
         "orientation": "h",
         "showlegend": false,
         "textposition": "auto",
         "type": "bar",
         "x": {
          "bdata": "GWNqIMvnNj9/UUymys1TPxz99ZSeil4/CmAQvGNtvz+5DCsiomzIP/VrwN+wbcg/2diynWzvzT9UYinltIfQPw==",
          "dtype": "f8"
         },
         "xaxis": "x",
         "y": [
          "country_encoded",
          "years_since_1990",
          "co2_per_capita",
          "co2_lag3",
          "co2_5yr_rolling_mean",
          "co2_lag1",
          "co2_lag2",
          "co2"
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "barmode": "relative",
        "legend": {
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Pooled Random Forest — Feature Importance (single model, all 10 countries)"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Importance"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Feature"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "importance_df = pd.DataFrame({\n",
    "    \"feature\": rf_feature_names,\n",
    "    \"importance\": rf.feature_importances_,\n",
    "}).sort_values(\"importance\", ascending=True)\n",
    "\n",
    "fig = px.bar(\n",
    "    importance_df, x=\"importance\", y=\"feature\", orientation=\"h\",\n",
    "    title=\"Pooled Random Forest — Feature Importance (single model, all 10 countries)\",\n",
    "    labels={\"importance\": \"Importance\", \"feature\": \"Feature\"},\n",
    "    color_discrete_sequence=[\"#2ca02c\"],\n",
    ")\n",
    "fig.update_layout(template=\"plotly_white\")\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dd8732ed",
   "metadata": {},
   "source": [
    "As with the Linear Regression model, `co2` and the short lags (`co2_lag1`/`co2_lag2`) dominate feature\n",
    "importance, since next year's emissions are best predicted by the current level. `country_encoded`\n",
    "typically ranks next, reflecting how strongly the pooled model relies on knowing which country's scale\n",
    "it's looking at to split effectively. Longer-horizon features (`co2_lag3`, `years_since_1990`,\n",
    "`ghg_intensity`-adjacent signals like `co2_per_capita`) contribute comparatively little marginal\n",
    "information once the recent lags are already included."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df54ec0a",
   "metadata": {},
   "source": [
    "<a id=\"w3-6\"></a>\n",
    "### 3.6 Model Comparison Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "90b63799",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.175484Z",
     "iopub.status.busy": "2026-07-29T14:01:51.175343Z",
     "iopub.status.idle": "2026-07-29T14:01:51.189205Z",
     "shell.execute_reply": "2026-07-29T14:01:51.188563Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Baseline MAE</th>\n",
       "      <th>LR MAE</th>\n",
       "      <th>RF MAE</th>\n",
       "      <th>Baseline RMSE</th>\n",
       "      <th>LR RMSE</th>\n",
       "      <th>RF RMSE</th>\n",
       "      <th>Best Model</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>315.10</td>\n",
       "      <td>209.64</td>\n",
       "      <td>1189.23</td>\n",
       "      <td>344.12</td>\n",
       "      <td>217.08</td>\n",
       "      <td>1295.89</td>\n",
       "      <td>LR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>212.54</td>\n",
       "      <td>493.51</td>\n",
       "      <td>366.32</td>\n",
       "      <td>292.33</td>\n",
       "      <td>507.53</td>\n",
       "      <td>384.40</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>191.84</td>\n",
       "      <td>164.68</td>\n",
       "      <td>158.78</td>\n",
       "      <td>197.19</td>\n",
       "      <td>206.60</td>\n",
       "      <td>180.75</td>\n",
       "      <td>RF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>44.24</td>\n",
       "      <td>28.14</td>\n",
       "      <td>35.20</td>\n",
       "      <td>50.31</td>\n",
       "      <td>33.11</td>\n",
       "      <td>39.56</td>\n",
       "      <td>LR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>36.53</td>\n",
       "      <td>73.83</td>\n",
       "      <td>102.99</td>\n",
       "      <td>39.83</td>\n",
       "      <td>78.26</td>\n",
       "      <td>105.43</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>39.59</td>\n",
       "      <td>93.51</td>\n",
       "      <td>88.09</td>\n",
       "      <td>46.43</td>\n",
       "      <td>104.04</td>\n",
       "      <td>95.59</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>19.74</td>\n",
       "      <td>61.67</td>\n",
       "      <td>17.31</td>\n",
       "      <td>26.35</td>\n",
       "      <td>68.48</td>\n",
       "      <td>21.63</td>\n",
       "      <td>RF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>18.84</td>\n",
       "      <td>20.96</td>\n",
       "      <td>41.43</td>\n",
       "      <td>23.47</td>\n",
       "      <td>23.56</td>\n",
       "      <td>42.28</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>12.27</td>\n",
       "      <td>32.18</td>\n",
       "      <td>14.73</td>\n",
       "      <td>17.08</td>\n",
       "      <td>32.90</td>\n",
       "      <td>17.68</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>6.70</td>\n",
       "      <td>19.94</td>\n",
       "      <td>10.22</td>\n",
       "      <td>8.89</td>\n",
       "      <td>20.61</td>\n",
       "      <td>10.91</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Country  Baseline MAE  LR MAE   RF MAE  Baseline RMSE  LR RMSE  \\\n",
       "0           China        315.10  209.64  1189.23         344.12   217.08   \n",
       "1   United States        212.54  493.51   366.32         292.33   507.53   \n",
       "2           India        191.84  164.68   158.78         197.19   206.60   \n",
       "3          Russia         44.24   28.14    35.20          50.31    33.11   \n",
       "4           Japan         36.53   73.83   102.99          39.83    78.26   \n",
       "5         Germany         39.59   93.51    88.09          46.43   104.04   \n",
       "6          Brazil         19.74   61.67    17.31          26.35    68.48   \n",
       "7  United Kingdom         18.84   20.96    41.43          23.47    23.56   \n",
       "8    South Africa         12.27   32.18    14.73          17.08    32.90   \n",
       "9       Australia          6.70   19.94    10.22           8.89    20.61   \n",
       "\n",
       "   RF RMSE Best Model  \n",
       "0  1295.89         LR  \n",
       "1   384.40   Baseline  \n",
       "2   180.75         RF  \n",
       "3    39.56         LR  \n",
       "4   105.43   Baseline  \n",
       "5    95.59   Baseline  \n",
       "6    21.63         RF  \n",
       "7    42.28   Baseline  \n",
       "8    17.68   Baseline  \n",
       "9    10.91   Baseline  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "comparison_df = (\n",
    "    baseline_df.merge(lr_df, on=\"country\").merge(rf_df, on=\"country\")\n",
    ")\n",
    "comparison_df = comparison_df[\n",
    "    [\"country\", \"baseline_mae\", \"lr_mae\", \"rf_mae\", \"baseline_rmse\", \"lr_rmse\", \"rf_rmse\"]\n",
    "]\n",
    "comparison_df.columns = [\n",
    "    \"Country\", \"Baseline MAE\", \"LR MAE\", \"RF MAE\", \"Baseline RMSE\", \"LR RMSE\", \"RF RMSE\",\n",
    "]\n",
    "comparison_df[\"Best Model\"] = comparison_df[[\"Baseline MAE\", \"LR MAE\", \"RF MAE\"]].idxmin(axis=1).str.replace(\" MAE\", \"\")\n",
    "\n",
    "comparison_df.round(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6fab0caf",
   "metadata": {},
   "source": [
    "**Note:** `LR MAE`/`LR RMSE` reflect a per-country Linear Regression evaluated on that country's own\n",
    "test set, while `RF MAE`/`RF RMSE` reflect the single pooled Random Forest model evaluated per country\n",
    "— the two are directly comparable in units (MtCO2) but come from different training strategies, as\n",
    "explained in Section 3.1 and 3.5.\n",
    "\n",
    "**Conclusion.** The results bear out the pattern seen in the table above: the naive no-change baseline\n",
    "wins outright for roughly half of the 10 countries, since annual emissions rarely swing dramatically\n",
    "outside of shocks like COVID-19 — beating it requires a model to genuinely add predictive signal rather\n",
    "than just tracking the trend. Linear Regression wins for several of the remaining countries (e.g.\n",
    "China, Russia), where the lag and trend features successfully linearly extrapolate a clear, consistent\n",
    "direction. The pooled Random Forest is competitive for some countries (Brazil, India) but fails badly\n",
    "for China specifically — its MAE there (~1,189 Mt) is an order of magnitude worse than every other\n",
    "model. This is a textbook illustration of a known Random Forest limitation: tree-based models predict\n",
    "by averaging training-set leaf values, so they **cannot extrapolate beyond the range of targets seen\n",
    "during training**. Because China's emissions kept climbing well past the highest value in the pooled\n",
    "training set, the pooled RF structurally under-predicts China's future emissions no matter how the\n",
    "trees split — a limitation that per-country Linear Regression, which fits a continuous linear function\n",
    "with no such ceiling, does not share. This reinforces the Section 3.5 teaching point from the opposite\n",
    "direction: pooling more data can fix a small-sample problem, but it introduces a new failure mode for\n",
    "any country whose scale is a genuine outlier relative to the pool."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "49b220dd",
   "metadata": {},
   "source": [
    "<a id=\"week4\"></a>\n",
    "## Week 4: Time-Series Forecasting with ETS(A,Ad,N) — Holt's Damped Trend\n",
    "\n",
    "*Learning objective: apply ETS(A,Ad,N) to generate multi-year emissions forecasts with confidence\n",
    "intervals; understand why a damped trend model is well-suited to long-range annual emissions data.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "14e5f05d",
   "metadata": {},
   "source": [
    "<a id=\"w4-1\"></a>\n",
    "### 4.1 Concept Introduction\n",
    "\n",
    "The **ETS (Error, Trend, Seasonality) state-space framework** decomposes a time series into three\n",
    "components. For this project we use **ETS(A, Ad, N)** — Holt's damped trend method:\n",
    "\n",
    "- **E (Error): additive** — the model's residuals are added to the state.\n",
    "- **T (Trend): additive damped** — the trend decays toward zero over the forecast horizon via a\n",
    "  damping parameter &phi; (0 < &phi; < 1).\n",
    "- **S (Seasonality): none** — annual data has no within-year seasonal cycle.\n",
    "\n",
    "**Why ETS(A,Ad,N) is appropriate for annual emissions data:**\n",
    "\n",
    "- No within-year seasonality to model — our data is one observation per country per year.\n",
    "- A damped trend prevents unbounded long-range projections (unlike, say, a unit-root ARIMA model\n",
    "  that can extrapolate a straight-line trend indefinitely).\n",
    "- It works reliably with approximately 30 data points, using fewer free parameters than many\n",
    "  alternative forecasting methods.\n",
    "- It is physically sensible: real-world emissions trajectories tend to slow, plateau, or gradually\n",
    "  reverse as economies mature and policy takes effect — not grow at a constant rate indefinitely."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c0a1f23c",
   "metadata": {},
   "source": [
    "<a id=\"w4-2\"></a>\n",
    "### 4.2 Model Fitting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "799732db",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.191129Z",
     "iopub.status.busy": "2026-07-29T14:01:51.190945Z",
     "iopub.status.idle": "2026-07-29T14:01:51.360536Z",
     "shell.execute_reply": "2026-07-29T14:01:51.360075Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitted ETS(A,Ad,N) models for 10 countries on the 1990-2018 training window.\n"
     ]
    }
   ],
   "source": [
    "train_years = range(1990, 2019)\n",
    "\n",
    "ets_models = {}\n",
    "for country in COUNTRIES:\n",
    "    series = base[(base[\"country\"] == country) & (base[\"year\"].isin(train_years))].sort_values(\"year\")\n",
    "    y = pd.Series(series[\"co2\"].values, index=series[\"year\"].values)\n",
    "\n",
    "    model = ExponentialSmoothing(y, trend=\"add\", damped_trend=True, seasonal=None)\n",
    "    ets_models[country] = model.fit(optimized=True)\n",
    "\n",
    "print(f\"Fitted ETS(A,Ad,N) models for {len(ets_models)} countries on the 1990-2018 training window.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dcb9020f",
   "metadata": {},
   "source": [
    "Inspect the fitted smoothing-level (alpha), smoothing-trend (beta*), and damping (phi) parameters\n",
    "for four representative countries before interpreting what they mean."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "fa565aed",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.363285Z",
     "iopub.status.busy": "2026-07-29T14:01:51.362636Z",
     "iopub.status.idle": "2026-07-29T14:01:51.373182Z",
     "shell.execute_reply": "2026-07-29T14:01:51.371805Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>alpha (level)</th>\n",
       "      <th>beta* (trend)</th>\n",
       "      <th>phi (damping)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>0.521</td>\n",
       "      <td>0.399</td>\n",
       "      <td>0.976</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Germany</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.969</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>0.646</td>\n",
       "      <td>0.646</td>\n",
       "      <td>0.995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>China</td>\n",
       "      <td>1.000</td>\n",
       "      <td>0.865</td>\n",
       "      <td>0.873</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country  alpha (level)  beta* (trend)  phi (damping)\n",
       "0  United Kingdom          0.521          0.399          0.976\n",
       "1         Germany          0.000          0.000          0.969\n",
       "2           India          0.646          0.646          0.995\n",
       "3           China          1.000          0.865          0.873"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "param_rows = []\n",
    "for country in [\"United Kingdom\", \"Germany\", \"India\", \"China\"]:\n",
    "    p = ets_models[country].params\n",
    "    param_rows.append({\n",
    "        \"country\": country,\n",
    "        \"alpha (level)\": round(p[\"smoothing_level\"], 3),\n",
    "        \"beta* (trend)\": round(p[\"smoothing_trend\"], 3),\n",
    "        \"phi (damping)\": round(p[\"damping_trend\"], 3),\n",
    "    })\n",
    "pd.DataFrame(param_rows)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "351c1340",
   "metadata": {},
   "source": [
    "**Interpreting &phi;.** A damping parameter &phi; close to 1 means the fitted trend barely decays and\n",
    "the model extrapolates close to a straight line over the forecast horizon — typical of a country still\n",
    "in an active growth or decline phase with a well-established recent direction. A &phi; noticeably below\n",
    "1 means the trend flattens out quickly, which the model has learned from historical periods where the\n",
    "country's emissions growth (or decline) visibly decelerated. Countries like the UK and Germany, whose\n",
    "post-2000 emissions decline has itself been gradually slowing as the \"easy wins\" of coal phase-out are\n",
    "exhausted, tend to show more damping than a country like India, which has shown a persistently steep,\n",
    "undamped growth trajectory."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a9634c03",
   "metadata": {},
   "source": [
    "<a id=\"w4-3\"></a>\n",
    "### 4.3 Forecasting to 2043"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "22b35240",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.374893Z",
     "iopub.status.busy": "2026-07-29T14:01:51.374734Z",
     "iopub.status.idle": "2026-07-29T14:01:51.423905Z",
     "shell.execute_reply": "2026-07-29T14:01:51.422965Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Generated 1990-2018 fitted values plus 2019-2043 forecasts (with 95% CI) for all 10 countries.\n"
     ]
    }
   ],
   "source": [
    "FORECAST_YEARS = list(range(2019, 2044))  # 2019-2023 holdout + 2024-2043 out-of-sample\n",
    "N_STEPS = len(FORECAST_YEARS)\n",
    "\n",
    "ets_forecasts = {}\n",
    "for country in COUNTRIES:\n",
    "    fit = ets_models[country]\n",
    "    point_forecast = fit.forecast(N_STEPS)\n",
    "    point_forecast.index = FORECAST_YEARS\n",
    "\n",
    "    # HoltWintersResults has no get_forecast(); build a 95% CI via bootstrap simulation instead\n",
    "    sims = fit.simulate(nsimulations=N_STEPS, repetitions=1000, error=\"add\",\n",
    "                         random_errors=\"bootstrap\", random_state=RANDOM_STATE)\n",
    "    sims.index = FORECAST_YEARS\n",
    "\n",
    "    ets_forecasts[country] = {\n",
    "        \"mean\": point_forecast,\n",
    "        \"ci_lower\": sims.quantile(0.025, axis=1),\n",
    "        \"ci_upper\": sims.quantile(0.975, axis=1),\n",
    "        \"fitted\": fit.fittedvalues,\n",
    "    }\n",
    "\n",
    "print(\"Generated 1990-2018 fitted values plus 2019-2043 forecasts (with 95% CI) for all 10 countries.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e497ae15",
   "metadata": {},
   "source": [
    "Plot each country's historical actuals, fitted values, 2019-2023 holdout actuals, and forecast to\n",
    "2043 with its 95% confidence interval, so the fit quality and forecast trajectory can be inspected\n",
    "visually."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "96938bdd",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.426172Z",
     "iopub.status.busy": "2026-07-29T14:01:51.425529Z",
     "iopub.status.idle": "2026-07-29T14:01:51.593489Z",
     "shell.execute_reply": "2026-07-29T14:01:51.592867Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "IbByaBFno0Coxks3SXakQK5H4XqUVqVAIbByaJHEpkB56SYxyCuoQKAaL91kLqpAHVpkO59Wq0AzMzMzs3CrQOkmMQisNqpAz/dT4+W7q0CF61G4nnesQH0/NV46GK1AkxgEVi4CsEBMN4lBQOOyQHWTGAT2WrRAVg4tsv35tkDD9ShcL1a5QD81XrqpPrtAlkOLbGdEvUBWDi2yfcm+QBsv3SQG0cBAJQaBlROYwkCHFtnOpxPDQGiR7Xwva8NAf2q8dAN8w0DsUbgeBUHDQGZmZmYWCsNAEoPAygGIw0DsUbgeZTXEQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "Ao0qwyc8o0DrNBh3BSWkQDHtC62AWaVASL9JS7sapkDFmoB/GvCnQLs2yW5bXqlAKP9gky/Xq0CpNAaEWGisQCJtHxyWpKtAXPXu0I1PqUDkJ5/dvsasQP3WARTOJK1A1OiOzOqlrUAk1VSyFSWxQDsKHyM/MrVA5g0XEkW8tUBofA8HcB65QE4HDdQWX7tA0bCyaursvED95AJEGv6+QDJ5CLSsEcBAfoY6lYn4wUDsAhxtkxLEQLhtte2DncNAEiW8YoS9w0AEOMAiaJLDQL1UzcoWF8NApUBOEqnbwkC6OPMVq+HDQA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "uB6F68HsxECcxCCwQkjFQNnO91MzCsZAlkOLbOffxkDVeOkmAcbHQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "LJEHt+rCxEBtHj8Jdz7FQAhQq3VSqsVAg8DzJHsIxkCM8wx1rlrGQLOmyDNxosZAVdDbzRbhxkDmyVSUxxfHQGtmKzaGR8dAmkfQhzRxx0A90lavl5XHQHMe9shbtcdA65UbFRfRx0Aaxhm/TOnHQAvllElv/sdAs5sjrOIQyECR9SUs/iDIQH73jvkNL8hAflRBl1Q7yEBPv6cVDEbIQGfdWCVnT8hAjOTZBpJXyEDA8O1bs17IQAgZUN7sZMhADI04/1tqyEA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          11075.999958247994,
          11801.085201948672,
          12598.347345212342,
          13452.436784896558,
          14293.24731402016,
          15012.095571575448,
          15936.133765040335,
          16811.572155633374,
          17546.6282796864,
          18362.71092481478,
          19144.41108148297,
          20046.28124018609,
          20767.33412370287,
          21661.974511548768,
          22501.56583402141,
          23526.80312668632,
          24259.109933222557,
          24954.566287763064,
          25717.97508548272,
          26497.39474099336,
          27471.877054543358,
          28293.267448971677,
          29025.74708038896,
          29233.610806657587,
          30081.551032116455,
          8217.003115136666,
          8151.096620009144,
          8147.8104491382155,
          8330.130336800996,
          8586.283901267656,
          8413.879543205441,
          8098.63303419222,
          8275.190567776814,
          8196.665583979307,
          8262.889406435503,
          8149.562295002796,
          8237.732571381639,
          8400.210962989877,
          8569.140592218675,
          8664.187783815287,
          8872.537950455982,
          8962.711044335801,
          9218.409134911532,
          9387.37249789631,
          9445.584243768659,
          9695.79073673098,
          9877.037983066684,
          10093.441880213482,
          10299.672566926063,
          10414.54808096112
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: China"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "QmDl0MILtEA/NV66adSzQOxRuB7FOrRA7FG4HoWftEBzaJHt3PG0QMHKoUXWMbVA001iEBjhtUCgGi/dJCm2QI/C9ShcaLZALbKd70eotkDFILByKIe3QFpkO9+PD7dAbef7qdE7t0A9CtejcHa3QFK4HoWL37dASgwCK+fut0B/arx0U523QG8Sg8CK6bdAarx0kzgft0DJdr6fGm61QAAAAABAJbZAAiuHFvmitUA730+Nd9O0QA4tsp1vYbVA9ihcj2KbtUAdWmQ7f/i0QCcxCKxcfbRAbxKDwGpLtEDb+X5qPPG0QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "6FA9LDjfs0B0E+lSc1m0QMUiAP8sOLRAQbeKxNpwtECA/SQnq8e0QGnLjatLGbVAA4p3e2datUA6WeFkpPS1QPf71FhXUrZAmYOXuV2VtkDZv+2ytdG2QD+UwACRkrdA2/EVOoxat0BiIM3NNmK3QFDJao8fjbdApmTcXOjqt0CyMp+FHgy4QF7piLuHybdAVJrJ/fjvt0AN2NTuKk63QHbHJdqVsbVALhUmAvPYtUCv2B4fWYW1QF+jAf8/ybRAV5E9KfEUtUD+SHMfH2i1QFp95xZ5/rRA2KCmk0d8tEBiZ3YiCzO0QA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "9P3UeOlztEBiEFg59FGyQNv5fmocnLNASgwCK2e/s0B56SYxaDazQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "kMWDz5axtECHiOKbWKi0QDkfcQ1PoLRAfnfG4VGZtECPbNUWPpO0QLphkTv1jbRAKHVy11yJtEBJft3lXYW0QJes12LkgbRAhD3E5t5+tEDIFTZPPny0QP2LIHP1ebRAwajr4Ph3tEDnqCGlPna0QFCglhi+dLRAKJAQtW9ztEBx1JbvTHK0QLAerBdQcbRAp9POOnRwtEDeC7ELtW+0QJsVrMwOb7RA1IcDPX5utEAXCpqIAG60QH0zxjmTbbRAQ4gALTRttEA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          5487.781609317296,
          5564.710195968693,
          5636.603795218148,
          5680.5654073696,
          5751.954366005936,
          5844.889023906358,
          5908.8545298769905,
          5980.092783073836,
          6057.703296513455,
          6108.620004975152,
          6177.77353473234,
          6231.062473212578,
          6291.750791549042,
          6316.002948493717,
          6415.116787856799,
          6506.231635050039,
          6511.942263273223,
          6592.577832214774,
          6616.145898836581,
          6692.773276603423,
          6737.147221904387,
          6826.0998844088235,
          6866.79350120769,
          6911.4033912667455,
          7000.7874433695815,
          2529.218167298051,
          2525.022675423038,
          2588.652087142107,
          2742.9090642567116,
          2883.955458252611,
          2990.3125351962894,
          3088.396788107465,
          3184.8493626523355,
          3326.5679779570687,
          3380.8207287813843,
          3551.9936564841837,
          3586.8931253598844,
          3705.969878444151,
          3765.897999660425,
          3889.7995911242174,
          3979.2592621565905,
          4086.91679900708,
          4189.477152534405,
          4273.948727316529,
          4425.966165507848,
          4521.266931076854,
          4597.4045755610705,
          4713.918384077617,
          4810.57728887751,
          4817.5253971452585
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: United States"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "N4lBYOUPgkDJdr6fGjuDQAisHFpke4RAarx0kxgqhUDTTWIQWFCGQKRwPQrXw4dAiUFg5dC8iUArhxbZzs+KQCUGgZVDXotAZDvfT40JjkDsUbgehdiOQN0kBoGVSY9AAAAAAAAjkEA730+Nl7GQQG3n+6lxupFAUI2XbpKtkkAQWDm0SDWUQD0K16PwxZVAWDm0yHZJl0BaZDvfTzWZQIXrUbgeOppA4XoUrseWm0Bt5/up8RueQAIrhxZZLZ9AyXa+nxrIoECq8dJNom+hQK5H4XoUYaJAbef7qXHzokBiEFg5dEakQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "uFZupCoZgkDFBbBk8B+DQJwqr1AnSIRA7DQKOMOThUBorMc2xUyGQBP4Re2DTIdA4Z+GoDLHiECSmVmXwPeKQPTuL3xiXYxAg1RtWmbMjEAMaca7/C6PQKglpHSQM5BAAlxO50BTkEAIyf8EVZuQQD3u8FWlGZFACjGZR4MzkkCwPs5TGGaTQBVThdVoJJVAOJTGz6oGl0DSnZOyk8WYQJXOVKXPzZpACc7mDRbvm0APi5w4KBCdQF2O2bFrhJ9AEp/7w5t2oECBLWI7eZyhQLEz4Uv7XKJASVcIpaw9o0ChqEbr6MujQA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "mpmZmVlmpEBYObTIdu2iQJMYBFaO56RAJQaBlUMepkCNl24Sg+2nQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "a40UOgoLpUAcLd8o3PmlQKT8G2d856ZAnl8TfOzTp0AY4hjtLb+oQK65jT1CqalAZEPj7iqSqkBUfp2A6XmrQDeDVXB/YKxAt/i7Oe5FrUCshJtWNyquQCo62z5cDa9AggSBaF7vr0CQB9qjH2iwQCqVXycA2LBAiZYJd1FHsUDSqSRKFLaxQKbNEldJJLJAdo1MU/GRskBQLGLzDP+yQDXO/Oqca7NA8J/f7KHXs0Bq/eiqHEO0QJaWE9YNrrRA1ZJ3HnYYtUA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          2760.4666959116703,
          2930.9467403215094,
          3118.5606494040157,
          3309.6066423270336,
          3524.7515383232203,
          3741.7262761211623,
          3988.0478488758567,
          4234.744190110818,
          4474.943143506426,
          4744.939677143037,
          5026.709907851024,
          5329.810392628715,
          5626.787092723525,
          5924.1936681380585,
          6224.7124690225755,
          6549.104948583522,
          6871.214039131567,
          7184.993075100323,
          7591.348277773037,
          7933.9543480998955,
          8275.915677428575,
          8621.911631302151,
          8973.062769915992,
          9337.91217418399,
          9723.799986042846,
          4299.996060470517,
          4207.723127496624,
          4137.358984775702,
          4056.5103218575946,
          4004.9052835805005,
          3970.862116046529,
          3912.3132177515363,
          3850.6858323789907,
          3793.0510042308897,
          3714.756734526675,
          3660.474913921779,
          3596.8990374744076,
          3520.206669719509,
          3450.453558210042,
          3374.812142766336,
          3324.3688363528877,
          3253.837575306468,
          3173.1917002707632,
          3119.975146401832,
          3042.645851767044,
          2973.334648705309,
          2897.9207755485872,
          2827.9723170151956,
          2735.067510094026,
          2656.404777768715
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: India"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "IbByaJHQo0AQWDm0SM+iQEa28/3UrZ5AmpmZmRkqnUAv3SQGgbuZQKAaL90kSZlAeekmMYjKmEBg5dAi2yeXQA4tsp1v55ZAMQisHFpYl0D8qfHSTSKXQOf7qfFSuJdAuB6F61GRl0AbL90kBgyYQPT91HhpJZhAUrgehetvmEDByqFFtl2ZQPYoXI9CYZlAgZVDi+zSmUBt5/up8SSYQAwCK4eWhJlA+n5qvPRTmkAj2/l+apCaQKabxCAwlplAObTIdj6VmUDl0CLb+YyZQFpkO99PdZlANV66SQz0mUBxPQrXo7eaQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "p/hfO5QgpEB0AUwN4pyhQI5ghbDHa6BAqGnF97XPnECPfUNRUo6aQDKxSEWcI5hAn6XScs0sl0AO03Fmr/WWQOYvoUcMVpZA9I+N3/UalkB5TJ0A53SWQGbmS/8+tJZArcLW8ktEl0CT76i94omXQMnMytOz85dAOnj+PyM4mEB0ZfpchH6YQFNouUqgJ5lA0RgAwLaCmUAbLGUl7OaZQKb+MT//D5lAueqehUBHmUAHDkyW5umZQKEl/p9scJpACKSTWhsgmkAUYNZ3INqZQCzMdrAlpZlAv0p56Xt5mUBrQn6XDrCZQA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "dZMYBNahmkD4U+Olm3+ZQGq8dJMYKppA001iENgtmkDXo3A9ihSbQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "tBPtTQZNmkBt6VHlBm6aQJvH1cRtiJpA8hIM3oydmkAFHNGLcq6aQEcj1Rb3u5pAfI8LhsfGmkB0TGpFbs+aQNMWthFa1ppAubjygePbmkBxbVZ1UeCaQAT+cp7c45pAej7wWLLmmkDYPiHu9uiaQIqle2XH6ppAGF4q+DrsmkCKvk86ZO2aQLEL1AhS7ppAa0mkRxDvmkDMeuR5qO+aQBpvsTsi8JpA8piIo4PwmkBrujSQ0fCaQDLVJOcP8ZpABVFLxkHxmkA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          1836.4566489421368,
          1855.9180606248628,
          1928.0911064660338,
          2001.5971333550945,
          2092.9633378765207,
          2182.9616538508108,
          2257.715120447854,
          2323.1119234046096,
          2420.0161199126555,
          2494.1629297752047,
          2582.9891830832375,
          2662.469868256327,
          2741.175443607315,
          2822.3383189508386,
          2929.321199785401,
          3010.3693750069274,
          3049.0436659246393,
          3162.5086132750575,
          3242.388783367184,
          3316.47340424663,
          3390.145180300131,
          3447.14474892564,
          3521.661440753655,
          3626.96159778134,
          3693.2360735737443,
          1477.6669119293288,
          1456.316166082822,
          1461.4866390926381,
          1443.3843182162418,
          1396.3155699815668,
          1391.826060616069,
          1382.4609786534254,
          1387.8099828557167,
          1397.8179182438835,
          1346.0416300452778,
          1362.1918813581594,
          1368.7552832902038,
          1377.0673972358404,
          1394.4572419869842,
          1401.8735038117006,
          1422.35295905758,
          1425.1867839438337,
          1433.035275853663,
          1464.036026992546,
          1461.9531297116414,
          1494.2846804068422,
          1513.0576241754377,
          1540.793211981424,
          1562.6065920540657,
          1544.8241380160248
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: Russia"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "9P3UeGkLkkCR7Xw/NTqSQIlBYOXQXZJAWmQ7309FkkASg8DKoRyTQKJFtvN9T5NA9ihcj8KCk0BSuB6F62OTQHWTGARWxZJARIts53tYk0BaZDvfz7CTQArXo3C9d5NASOF6FK7tk0B7FK5HYQ+UQHNoke18/JNAz/dT46UZlED2KFyPwr2TQDeJQWDlS5RAaJHtfL8yk0CNl24SAyGSQI/C9Shc7JJATmIQWLm0k0DLoUW2c1iUQC/dJAaBf5RADAIrhxaxk0CwcmiR7Q+TQKwcWmS7v5JAIbByaJGBkkAzMzMzM8qRQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "qaRnwmgLkkDs2MvZVU+SQGGlXZD2cpJANiY3Pz2NkkBBgI8P8GySQC9Btwi+PZNA1pqxfyhrk0DM71KR4JmTQMG1fnc8d5NA8SR+5XnVkkBxXGxn+GWTQIUw9LIUvJNAMfDx7ieBk0DOTPY6jPWTQNsWoUH0FZRAsAjnLvsBlEAl3tbrPB6UQKDF6WOYwZNAo7bqxBlPlEDJyZb9bDWTQJtVn9w/I5JAKbuUxDrukkDN0dtBSbaTQOb/ud7BWZRATNQmPZiAlECviI/V/7GTQNu8WYOwEJNAUIyESF7AkkA4OhyEGYKSQA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "mG4Sg0A4kUBxPQrXIzWQQF66SQwCipBArkfhepQWkEDhehSuR9eOQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "7THd7aTKkUAqKDz1A8uRQNqSm1xTy5FAhlGttZXLkUAFQf8lzcuRQFUkw3j7y5FARRyqLSLMkUC4vU6FQsyRQEualItdzJFAAidTIHTMkUDcy5P+hsyRQF0Zn8KWzJFAEUQL76PMkUAGyPXwrsyRQHUziyO4zJFAkVb60r/MkUCgR+s+xsyRQBSmjpzLzJFA3CtWGNDMkUAZzmTX08yRQHBWwvjWzJFAvmhcltnMkUAbRt3F28yRQPk/X5ndzJFA0akCIN/MkUA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          1188.9386985841486,
          1215.5248271280464,
          1228.6064126777853,
          1244.040551646639,
          1257.447246725571,
          1268.3948164620003,
          1278.7066740003122,
          1284.1456558989405,
          1288.229374358772,
          1290.7904069993851,
          1298.8268262334652,
          1307.628225434678,
          1313.429236130428,
          1317.3267645656,
          1321.9966248346896,
          1315.3588190870555,
          1329.8474869059382,
          1343.916399008013,
          1337.3591168391843,
          1336.1576430239948,
          1343.1943254543442,
          1351.446282845683,
          1347.47257800614,
          1356.5139845156639,
          1352.3272825214456,
          722.0310929738929,
          721.8128495184566,
          738.7583682973623,
          741.7634269620886,
          746.6976781207811,
          750.7901721864022,
          760.8516136268307,
          784.8770088007403,
          816.6916452921637,
          811.3143474518926,
          826.7229850797075,
          838.0249093606193,
          856.6521885596896,
          867.7885512039371,
          872.8103159567322,
          891.6094582733309,
          906.2726048552364,
          925.4243316689962,
          936.2790273372899,
          960.5336516428205,
          983.8153785680531,
          992.7148136114236,
          1022.2800938690527,
          1040.7547332549213,
          1067.572898388648
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: Japan"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "d76fGi97kEA9CtejcMePQMHKoUW2S45ADAIrhxb7jUDn+6nx0nmNQLbz/dR4X41A7FG4HoX9jUDy0k1iEByNQKJFtvP924xAqMZLN4n7i0ArhxbZzheMQNejcD0KmoxA6SYxCKwWjEBeukkMAvSLQMP1KFyPZItA16NwPQofi0C28/3UeLOLQE5iEFg5cYpAoBov3STFikAdWmQ736+IQHE9Ctej1YlAdZMYBFYkiUA5tMh2vnCJQIcW2c73/YlA6SYxCKzEiEDdJAaBlQaJQJZDi2zn74hA9ihcj8KEiEC6SQwCK7aHQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "JklT9mLBj0Am8z9kbFyPQMbcweqf+o5AZaTOJeSbjkBCkXN9IECOQDQJvh49541Akv4I9iKRjUC4p+2ouz2NQAZ004/x7IxAYh1nsa+ejEA0+E+84VKMQOFWoQJ0CYxARY8xdFPCi0DfxHGZbX2LQA8TV4+wOotA1cQoAgv6ikDnzmEpbLuKQMioS8PDfopAL571DwJEikDjhqXOFwuKQIvgBjj204lAgqK9/I6eiUCPXQE/1GqJQNx7/ZC4OIlAqT1w8C4IiUA+f/fCKtmIQIx4HdSfq4hA4xboUIJ/iEAtIT3FxlSIQA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "1XjpJjElhkAj2/l+ajmEQESLbOf7L4VAObTIdr7ehEDjpZvEII6CQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "+jrkGGIriECzGRONSQOIQOcuwbhy3IdAN7mThtO2h0DE8RcyYpKHQMDhOUUVb4dAupDPleNMh0BZ6DdDxCuHQGivDLSuC4dABAPnk5rshkCFuTXRf86GQHcfJZtWsYZAVIOXXxeVhkAyCS7JunmGQMRDYb05X4ZAFBSpWo1FhkB4VbP2riyGQPbeqByYFIZAHWeAi0L9hUDp2l40qOaFQMq7BDnD0IVAQxxI6o27hUDe1ZrGAqeFQGmWnHgck4VAbmW41dV/hUA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          812.0455776485253,
          807.033591737823,
          802.1786948497827,
          797.4759624806294,
          792.9206224058078,
          788.5080640250171,
          784.23380335404,
          780.0935084074474,
          776.082976924817,
          772.1981532905877,
          768.43508326019,
          757.173478822425,
          761.2590899307955,
          757.8388765645725,
          754.5258678145934,
          751.3166955814241,
          740.5916248024438,
          745.1969498805582,
          742.28016814048,
          739.4547906077356,
          736.7179999241912,
          734.0669683742491,
          731.4990256918535,
          729.0115733430569,
          718.98560784535,
          644.5767976991351,
          646.9862942225463,
          649.4737348927551,
          652.041682978438,
          654.6927043224636,
          657.4295109685881,
          678.8696241825413,
          663.1716530318384,
          666.1828097785302,
          669.2914028691675,
          672.5005717202529,
          675.813583236802,
          679.2337928671391,
          682.7646662453062,
          705.0245408161624,
          690.1728547348739,
          694.0576823866057,
          698.068208537627,
          702.2085022066024,
          706.482761798896,
          710.8953230608918,
          715.4506595980725,
          720.1533922523355,
          725.0082895800751,
          730.0202744234762
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: Germany"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "kxgEVg5Va0D4U+Olm6xsQKwcWmQ7M21AbxKDwMqJbkDy0k1iEMBvQAIrhxbZynBA5dAi2/kUckB3vp8aLy9zQDm0yHa+1XNAarx0kxh0dECwcmiR7UJ1QC2yne+nonVACtejcD28dUC4HoXrUYp1QG3n+6nxlnZADi2yne/FdkAOLbKd7w13QLpJDAIraXhAke18PzXKeUBmZmZmZlx4QPyp8dJNhHtAf2q8dJPefEBzaJHtfBd/QGQ730+NnIBAke18PzVkgUAIrBxaZIGAQFK4HoXru35ArkfhehQUf0BWDi2yncl9QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "3s3FxK9Va0Ds8khuLAptQN7fiRajVG5ATgVmgZDObkAHGzVuZwxwQJmwEvOQoXBAS4joVpaGcUBgmIkFGMtyQIB3REbZ33NA1waEcB6BdEACZYrnVhp1QH7LV5Ux5HVAlpiZyxc/dkCtpDEo/lN2QAJafGaHHXZA16yVvL4ld0BwUBQSdlB3QECEPzpQlHdACcHpkYXreEB8KpqaqEh6QLjWuXgQ13hAu6CMoEv7e0DuXakmAVJ9QLRjx9J1h39A0Ohhm9zSgEDs1ZA95JiBQH9iNIJ/tIBAP4q7VxIff0CWN91EQ3R/QA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "3SQGgZXLfUBEi2zn+/97QKJFtvP9CH9AsHJoke0AfkAdWmQ73z9+QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "oF9+NusmfkDo1MaHbYF+QEgarRA62X5ATQBGl2Uuf0B4b2lCBIF/QCsFd54p0X9AERL7UHQPgEBaSAnZKTWAQEdUe1O+WYBAyh4CaDp9gEDYifZ7pp+AQLv8VbQKwYBAR7av927hgECEWQPw2gCBQCMmkQxWH4FAhEqcg+c8gUDpuR9UllmBQB7udUdpdYFA6/jz8maQgUCLRni5laqBQH1v7cz7w4FAQnXBL5/cgUDCwlG2hfSBQIZGTAi1C4JAQfoFojIigkA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          525.259903632845,
          538.5051625961645,
          551.6634084684966,
          568.6760391799994,
          576.0341523003066,
          593.4434379471335,
          599.9455926445016,
          613.9860150302244,
          625.2275639910922,
          634.1092107769739,
          643.6429690291237,
          651.6854951926684,
          659.1742241097635,
          668.3781123261996,
          674.1129249204868,
          680.6110021944595,
          685.2956909639109,
          694.833058073337,
          705.40512905388,
          713.6793165578724,
          722.3163719824072,
          727.1891882932931,
          734.0424867917192,
          743.5859676380264,
          742.1790285319299,
          391.6848504596051,
          389.98103194222125,
          394.2162542254136,
          397.4235902688852,
          403.8750941700994,
          400.42882652978597,
          403.7870983062189,
          397.2813252768575,
          401.0527559072207,
          398.74448009175245,
          404.89815448921144,
          410.5782578378088,
          404.48629923153067,
          411.5294076843399,
          408.72390953625876,
          410.89914729101264,
          415.4389845080337,
          414.35756936271304,
          410.4866885135931,
          421.6210646494901,
          422.0420984512569,
          421.60532399876445,
          425.9857417548405,
          430.65765505122494,
          439.6151649516971
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: Brazil"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "w/UoXI/PgkD8qfHSTQuDQFTjpZvEjoJAlkOLbOccgkBCYOXQIvCBQIPAyqFFsYFADAIrhxZWgkCLbOf7qZWBQDEIrBxaxIFAMzMzMzONgUCDwMqhRciBQFTjpZvED4JAd76fGi+CgUDLoUW289yBQD0K16Nw64FAYhBYObTSgUBU46WbxL6BQEoMAiuHfIFA+n5qvHQHgUB9PzVeuuF+QBSuR+F6/n9AxSCwcmhbfUASg8DKoXd+QLKd76fG2X1A9P3UeOlse0BMN4lBYGd6QHsUrkfh9nhAHVpkO981eEBI4XoUrrt3QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "+WuFuVLygkBSW0su1J2CQNVq965prIJAguv0bHVtgkBu9xgRvQSCQNk+9iKeuIFAcRufbYFzgUAObSJkBNiBQBPp3XK3loFAAbPeztWZgUBZJumYgHyBQG77VNk4nYFA1NDXypvpgUAEPXr2566BQEx5thify4FA8K6BRUXngUAFqxFvJ+OBQHYT+HI7z4FAMOqP5l6SgUBhkdXrZByBQKe8xCJBdH9AUQvxcSjYfkDORc3zl+V8QKb4iWg65HxAMikhWUvIfEBEh+X/WjR7QA4X8SttxnlAn/B5LUUzeEBor/PsZBV3QA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "NV66SQzMdkCR7Xw/NWR0QGDl0CLbZXVA2c73U+Nxc0Dwp8ZLNz1zQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "E001naZ1dkA51fxeL4V1QHkmqRyQmnRATG1se6S1c0A2QaQCSdZyQGCZWhZb/HFAp/Lo8bgncUB20ryiQVhwQK2teQaqG29AdBKba6eQbUC1XOo/Pg9sQO6kO8syl2pAjKvpyEooaUA/g85eTcJnQIhmdBQDZWZAIFt9yjUQZUA8TkCysMNjQANdmkVAf2JArQTzPrJCYUCT/XGR1Q1gQGQYy8L0wF1AWDWw+eN0W0Ag6aeoHTdZQPALqOdIB1dA1AvB9w7lVEA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          387.67597990148766,
          380.5190756628571,
          376.4479702327654,
          377.08083633600626,
          381.0925253170778,
          389.18664292543986,
          392.4877991923466,
          399.3159939833221,
          408.10290282410006,
          412.76600554549725,
          421.4188129452553,
          429.93043541360424,
          447.21167225493036,
          458.2866285887329,
          466.4225377223751,
          477.20215626663065,
          484.09323167747556,
          494.36987506302427,
          513.0133860725306,
          525.3946149182916,
          540.6796739012623,
          560.6405382412196,
          554.8937114263896,
          560.9987659539316,
          576.2719054452167,
          -975.395724371693,
          -906.3253068029788,
          -830.5664577627199,
          -780.908276405842,
          -719.0010447102948,
          -651.1713638225586,
          -588.0079454650897,
          -506.9465052277807,
          -433.1341917165913,
          -384.74249219432755,
          -323.96009364336993,
          -262.8536179527326,
          -208.57332306338844,
          -150.3030227918257,
          -99.98650730369305,
          -49.664461117733694,
          1.7822929589598864,
          49.27912430436503,
          93.17648936780222,
          137.21850513891127,
          172.20907158046512,
          216.08943338193475,
          253.44301204561728,
          288.54007210301444,
          305.9118993260462
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: United Kingdom"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "bef7qfGOc0AUrkfhemB0QCUGgZVD1XJAz/dT46UFdEDwp8ZLNyt1QAisHFpkm3ZAwcqhRba7dkA9CtejcBN4QO58PzVelHdAlkOLbOdtd0AX2c73U6V3QBKDwMqhOXdAvHSTGARIdkDRItv5fkZ5QP7UeOkmFXxA4XoUrkcDekCWQ4ts5+t7QAaBlUOLEH1AVOOlm8TqfkDVeOkmMah9QM/3U+OlNX1A7nw/NV6kfUBeukkMAtd8QF66SQwCg3xAke18PzUafkAhsHJokZd8QM3MzMzMkHxAXI/C9SiAe0DHSzeJQVx8QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "xnd1Xdl0c0DII6dJ1Cd0QAtaFb8c6HRAU6AMMLb+c0Bb0PyWG4x0QKP1zTaIfnVAIcZFh5PDdkBtVe/lEDJ3QJxMy4VKQHhAm91+9EQueEDqEZwZPgh4QPNE4XB5H3hA0zNj7bTUd0BbaYSSqA53QJdNqKb38XhAG9qeTm14e0BR5hN3krZ6QNVOUyIz1ntApX92VNb1fEDPnAOVxJZ+QOo4WZK6Jn5A0VrEveKxfUAmyNz5+Nt9QKyFMQFqU31AaEWhCKftfEBhr5i2Ue99QGQ1Cn6VJH1ApZLkyv3ifEALUv9JHgx8QA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "EoPAyqFrfUBU46WbxDR7QIGVQ4tsd3tAjZduEoPMekCLbOf7qUl7QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "mzS64olofEDgGF4WH4p8QBcknfbwqXxATsHqNBfIfECHok9EqOR8QEIEIWq5/3xAK0vXzV4ZfUAbxw+IqzF9QOPHxLCxSH1AaJrGbIJefUAbdn/6LXN9QDLcC77Dhn1AHmqwTFKZfUDep7V356p9QPHnsVaQu31ANOJIUVnLfUDKS2goTtp9QN1MCP956H1AYVh2Yuf1fUCOkjBSoAJ+QNCfV0euDn5AIWe8OxoafkCICI+w7CR+QJgBtLQtL35AGzfE6uQ4fkA=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          504.73270181840064,
          506.09880317183985,
          517.0834535923593,
          524.9456179573446,
          531.5755316071256,
          537.9877172372251,
          541.4628787342683,
          546.4017308782965,
          559.2352556031626,
          554.833352637801,
          559.405150295166,
          568.86637086876,
          573.6506810030952,
          585.368552624183,
          589.5721875185569,
          590.3928264090054,
          589.0519921363298,
          591.6954546503812,
          597.2013564202886,
          604.0105303664459,
          601.186300648996,
          609.7379628782644,
          609.4150925122186,
          610.0481127022127,
          615.7041409599932,
          335.2116679076904,
          333.86807369362185,
          332.15061954685564,
          337.7166848580132,
          342.69338490331944,
          348.88459031041964,
          350.5954686787855,
          348.8381348525088,
          352.75459030453146,
          364.03726640220503,
          366.5321723132953,
          373.194048745459,
          371.9864411628931,
          374.6931219918237,
          380.96487092263953,
          385.7329774206814,
          390.67435348990114,
          392.66905805743943,
          393.37508769816503,
          396.892537712049,
          400.9120689442444,
          405.9322082466456,
          410.3309540047845,
          413.2314428171782,
          421.3556453208542
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: South Africa"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Historical actual (1990-2018)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "5dAi2/lgcUCiRbbz/XZxQLByaJHtxnFAFK5H4XoMckArhxbZzllyQAisHFpkD3NAVg4tsp19c0DZzvdT4wN0QPhT46Wb4HRAvHSTGAR+dUDufD81Xt51QKabxCCwWnZAzczMzMymdkAGgZVDiyx3QK5H4XoU4HdAWmQ7308ReECHFtnO93V4QHWTGARW7nhAWDm0yHZEeUASg8DKoW95QCPb+X5qUHlARIts5/s9eUCuR+F6FFB5QJqZmZmZ3XhA9ihcj8KJeECBlUOLbAl5QC2yne+nmnlASgwCK4fWeUDRItv5fux5QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "gray",
          "dash": "dot"
         },
         "mode": "lines",
         "name": "Fitted values",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "FW+/BPpgcUBVH2CoGIxxQI4xzad6kXFA0izPJ878cUApF4T/YUVyQN2HIgsZmHJAKxTlZHiKc0AXcmXUDORzQGNPSj06cXRAFvgtQSWBdUDxqeMzWQt2QO6zRsrhQnZA2yq0hsTBdkCKEo9KavN2QACW3pIwkXdA5EcCOXhmeEDwILzR4lh4QEzU4Ok8xnhAuX1ue5hMeUBf0T8Z4pN5QPlbIinmoXlADTIcTBVPeUCpqH/5HDN5QOz23evKVnlAIUXGwvSeeECm4OJ86kV4QIdlpEaoO3lAKM4arzr9eUAJVClVexh6QA==",
          "dtype": "f8"
         }
        },
        {
         "marker": {
          "color": "black",
          "size": 8,
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "Holdout actual (2019-2023)",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "zczMzMzueUCYbhKDwOh4QGQ730+NR3hAaJHtfD8BeECTGARWDgV4QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "crimson",
          "width": 2
         },
         "mode": "lines",
         "name": "Forecast to 2043",
         "type": "scatter",
         "x": {
          "bdata": "4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wc=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "BZGGSGEOekCzNJSjlSx6QHDPo1SCR3pAepjFiYJfekCWAU2K53R6QOycEMr5h3pAm0TG3vmYekATbbpaIah6QHFQx4+jtXpA1zIgPa7BekAwTT0qasx6QGQC9bD71XpAjgqWOIPeekCqdqOjHeZ6QDwqprHk7HpAwA1fVu/yekDqQ4EHUvh6QNCa+wEf/XpA1dy7h2YBe0A2Kr0WNwV7QLTNG5qdCHtAor/UlaULe0CK/sRNWQ57QNTNbOjBEHtAypPsjecSe0A=",
          "dtype": "f8"
         }
        },
        {
         "fill": "toself",
         "fillcolor": "rgba(220,20,60,0.15)",
         "hoverinfo": "skip",
         "line": {
          "color": "rgba(0,0,0,0)"
         },
         "name": "95% CI",
         "type": "scatter",
         "x": [
          2019,
          2020,
          2021,
          2022,
          2023,
          2024,
          2025,
          2026,
          2027,
          2028,
          2029,
          2030,
          2031,
          2032,
          2033,
          2034,
          2035,
          2036,
          2037,
          2038,
          2039,
          2040,
          2041,
          2042,
          2043,
          2043,
          2042,
          2041,
          2040,
          2039,
          2038,
          2037,
          2036,
          2035,
          2034,
          2033,
          2032,
          2031,
          2030,
          2029,
          2028,
          2027,
          2026,
          2025,
          2024,
          2023,
          2022,
          2021,
          2020,
          2019
         ],
         "y": [
          429.1180027994251,
          436.5995469036549,
          445.8116316385446,
          456.986088953534,
          467.0256637598982,
          479.6119586079378,
          493.1445706130772,
          504.1310753257016,
          516.5327663902145,
          525.3771169409213,
          539.6865247825018,
          553.3704708003968,
          564.1073551563882,
          577.3430687609361,
          588.0598097864171,
          597.6428301745788,
          611.3713052106266,
          624.8004429695034,
          633.9433922830576,
          642.3866430985157,
          651.8733702758138,
          660.6542607172747,
          673.6483507548719,
          683.0688051491974,
          696.4504935833218,
          325.6495870545417,
          330.21911189186324,
          330.0723691437676,
          330.56840777085756,
          334.72704672529443,
          337.58492925315636,
          342.85889670275026,
          340.74985822712443,
          349.5554662760778,
          349.8640881246969,
          355.49246412763074,
          360.1976111660167,
          361.7724527303322,
          366.47719866597487,
          368.0824597916243,
          368.6571070203639,
          372.95477291312994,
          377.6021897765165,
          382.76658016486687,
          388.4345783681242,
          393.3541187573349,
          396.9948203623918,
          401.83916807421826,
          406.119371544472,
          409.3242094598783
         ]
        }
       ],
       "layout": {
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "ETS(A,Ad,N) Forecast: Australia"
        },
        "xaxis": {
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def plot_country_forecast(country):\n",
    "    hist = base[(base[\"country\"] == country) & (base[\"year\"] <= 2018)].sort_values(\"year\")\n",
    "    holdout = base[(base[\"country\"] == country) & (base[\"year\"].between(2019, 2023))].sort_values(\"year\")\n",
    "    fc = ets_forecasts[country]\n",
    "\n",
    "    fig = go.Figure()\n",
    "    fig.add_trace(go.Scatter(x=hist[\"year\"], y=hist[\"co2\"], name=\"Historical actual (1990-2018)\",\n",
    "                              mode=\"lines\", line=dict(color=\"black\", width=2)))\n",
    "    fig.add_trace(go.Scatter(x=fc[\"fitted\"].index, y=fc[\"fitted\"].values, name=\"Fitted values\",\n",
    "                              mode=\"lines\", line=dict(color=\"gray\", dash=\"dot\")))\n",
    "    fig.add_trace(go.Scatter(x=holdout[\"year\"], y=holdout[\"co2\"], name=\"Holdout actual (2019-2023)\",\n",
    "                              mode=\"markers\", marker=dict(color=\"black\", size=8, symbol=\"diamond\")))\n",
    "    fig.add_trace(go.Scatter(x=fc[\"mean\"].index, y=fc[\"mean\"].values, name=\"Forecast to 2043\",\n",
    "                              mode=\"lines\", line=dict(color=\"crimson\", width=2)))\n",
    "    fig.add_trace(go.Scatter(\n",
    "        x=list(fc[\"ci_upper\"].index) + list(fc[\"ci_lower\"].index[::-1]),\n",
    "        y=list(fc[\"ci_upper\"].values) + list(fc[\"ci_lower\"].values[::-1]),\n",
    "        fill=\"toself\", fillcolor=\"rgba(220,20,60,0.15)\", line=dict(color=\"rgba(0,0,0,0)\"),\n",
    "        name=\"95% CI\", hoverinfo=\"skip\",\n",
    "    ))\n",
    "    fig.update_layout(title=f\"ETS(A,Ad,N) Forecast: {country}\", xaxis_title=\"Year\", yaxis_title=\"CO2 Emissions (Mt)\",\n",
    "                       template=\"plotly_white\", legend=dict(orientation=\"h\", y=-0.2))\n",
    "    return fig\n",
    "\n",
    "\n",
    "for country in COUNTRIES:\n",
    "    plot_country_forecast(country).show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "368988be",
   "metadata": {},
   "source": [
    "<a id=\"w4-4\"></a>\n",
    "### 4.4 Trend Interpretation"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b2335325",
   "metadata": {},
   "source": [
    "**United Kingdom.** The UK's damped-trend forecast projects a continued, gradually slowing decline in\n",
    "CO<sub>2</sub> emissions through 2043. This aligns with known real-world context: the UK's Climate\n",
    "Change Act and its legally binding net-zero-by-2050 target have driven a sustained coal phase-out and\n",
    "renewables build-out since 2010, and the damping captures the fact that the steepest, easiest\n",
    "reductions (closing coal plants) have already happened, leaving a shallower decline ahead.\n",
    "\n",
    "**Germany.** Similarly, Germany's forecast shows continued reduction, consistent with its\n",
    "*Energiewende* policy and coal-exit legislation, though the damping reflects the practical difficulty\n",
    "of decarbonising remaining hard-to-abate sectors (industry, transport) at the same pace as the initial\n",
    "power-sector transition.\n",
    "\n",
    "**India.** India's forecast shows continued growth in absolute emissions, consistent with its\n",
    "development trajectory — a rapidly growing economy and population with per-capita emissions still far\n",
    "below developed-country levels — though the damping parameter tempers the extrapolation rather than\n",
    "assuming India's historical growth rate holds unchanged for 20 more years.\n",
    "\n",
    "**China.** China's forecast trend is more muted than its historical growth rate, which is broadly\n",
    "consistent with China's own stated policy goal of peaking CO<sub>2</sub> emissions before 2030; the\n",
    "model has no knowledge of that policy target, so any flattening in its projection is inferred purely\n",
    "from a deceleration already visible in the recent training data, not from the policy itself.\n",
    "\n",
    "**On the confidence intervals:** for every country, the 95% CI band widens substantially over the\n",
    "20-year horizon — this is expected, since forecast uncertainty compounds with each additional step for\n",
    "any model built on ~30 historical observations. The widening CI is a useful, honest signal that\n",
    "long-range point forecasts (e.g. the exact 2043 value) should be treated as indicative of a direction\n",
    "and rough magnitude, not a precise prediction."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df6041ff",
   "metadata": {},
   "source": [
    "<a id=\"w4-5\"></a>\n",
    "### 4.5 Forecast Summary Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "69e69a13",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.595063Z",
     "iopub.status.busy": "2026-07-29T14:01:51.594936Z",
     "iopub.status.idle": "2026-07-29T14:01:51.608393Z",
     "shell.execute_reply": "2026-07-29T14:01:51.607892Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>2030 Forecast (MtCO2)</th>\n",
       "      <th>2035 Forecast (MtCO2)</th>\n",
       "      <th>2040 Forecast (MtCO2)</th>\n",
       "      <th>2020 Actual (MtCO2)</th>\n",
       "      <th>% Change 2020-&gt;2040</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>12138.7</td>\n",
       "      <td>12354.0</td>\n",
       "      <td>12463.1</td>\n",
       "      <td>10896.5</td>\n",
       "      <td>14.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>5242.0</td>\n",
       "      <td>5234.3</td>\n",
       "      <td>5230.5</td>\n",
       "      <td>4690.0</td>\n",
       "      <td>11.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>3974.7</td>\n",
       "      <td>4534.1</td>\n",
       "      <td>5079.6</td>\n",
       "      <td>2422.7</td>\n",
       "      <td>109.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>1721.0</td>\n",
       "      <td>1723.3</td>\n",
       "      <td>1724.1</td>\n",
       "      <td>1631.9</td>\n",
       "      <td>5.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>1139.1</td>\n",
       "      <td>1139.2</td>\n",
       "      <td>1139.2</td>\n",
       "      <td>1037.3</td>\n",
       "      <td>9.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>726.2</td>\n",
       "      <td>709.6</td>\n",
       "      <td>695.4</td>\n",
       "      <td>647.2</td>\n",
       "      <td>7.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>536.1</td>\n",
       "      <td>555.2</td>\n",
       "      <td>571.6</td>\n",
       "      <td>448.0</td>\n",
       "      <td>27.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>212.7</td>\n",
       "      <td>158.1</td>\n",
       "      <td>109.8</td>\n",
       "      <td>326.3</td>\n",
       "      <td>-66.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>472.4</td>\n",
       "      <td>477.6</td>\n",
       "      <td>481.6</td>\n",
       "      <td>435.3</td>\n",
       "      <td>10.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>429.4</td>\n",
       "      <td>431.5</td>\n",
       "      <td>432.7</td>\n",
       "      <td>398.5</td>\n",
       "      <td>8.6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Country  2030 Forecast (MtCO2)  2035 Forecast (MtCO2)  \\\n",
       "0           China                12138.7                12354.0   \n",
       "1   United States                 5242.0                 5234.3   \n",
       "2           India                 3974.7                 4534.1   \n",
       "3          Russia                 1721.0                 1723.3   \n",
       "4           Japan                 1139.1                 1139.2   \n",
       "5         Germany                  726.2                  709.6   \n",
       "6          Brazil                  536.1                  555.2   \n",
       "7  United Kingdom                  212.7                  158.1   \n",
       "8    South Africa                  472.4                  477.6   \n",
       "9       Australia                  429.4                  431.5   \n",
       "\n",
       "   2040 Forecast (MtCO2)  2020 Actual (MtCO2)  % Change 2020->2040  \n",
       "0                12463.1              10896.5                 14.4  \n",
       "1                 5230.5               4690.0                 11.5  \n",
       "2                 5079.6               2422.7                109.7  \n",
       "3                 1724.1               1631.9                  5.7  \n",
       "4                 1139.2               1037.3                  9.8  \n",
       "5                  695.4                647.2                  7.5  \n",
       "6                  571.6                448.0                 27.6  \n",
       "7                  109.8                326.3                -66.3  \n",
       "8                  481.6                435.3                 10.6  \n",
       "9                  432.7                398.5                  8.6  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "summary_rows = []\n",
    "for country in COUNTRIES:\n",
    "    mean_fc = ets_forecasts[country][\"mean\"]\n",
    "    actual_2020 = base.loc[(base[\"country\"] == country) & (base[\"year\"] == 2020), \"co2\"].values[0]\n",
    "    f2030, f2035, f2040 = mean_fc.loc[2030], mean_fc.loc[2035], mean_fc.loc[2040]\n",
    "    pct_change = (f2040 - actual_2020) / actual_2020 * 100\n",
    "    summary_rows.append({\n",
    "        \"Country\": country,\n",
    "        \"2030 Forecast (MtCO2)\": round(f2030, 1),\n",
    "        \"2035 Forecast (MtCO2)\": round(f2035, 1),\n",
    "        \"2040 Forecast (MtCO2)\": round(f2040, 1),\n",
    "        \"2020 Actual (MtCO2)\": round(actual_2020, 1),\n",
    "        \"% Change 2020->2040\": round(pct_change, 1),\n",
    "    })\n",
    "\n",
    "forecast_summary_df = pd.DataFrame(summary_rows)\n",
    "forecast_summary_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "44a1a4d7",
   "metadata": {},
   "source": [
    "<a id=\"w4-6\"></a>\n",
    "### 4.6 Model Validation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "b6a09ed6",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.609892Z",
     "iopub.status.busy": "2026-07-29T14:01:51.609771Z",
     "iopub.status.idle": "2026-07-29T14:01:51.628630Z",
     "shell.execute_reply": "2026-07-29T14:01:51.628044Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>ets_mae</th>\n",
       "      <th>ets_rmse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>290.50</td>\n",
       "      <td>389.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>297.40</td>\n",
       "      <td>346.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>210.43</td>\n",
       "      <td>238.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>31.57</td>\n",
       "      <td>34.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>95.94</td>\n",
       "      <td>103.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>104.62</td>\n",
       "      <td>109.79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>17.54</td>\n",
       "      <td>21.94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>9.37</td>\n",
       "      <td>10.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>22.82</td>\n",
       "      <td>23.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>26.22</td>\n",
       "      <td>29.64</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country  ets_mae  ets_rmse\n",
       "0           China   290.50    389.31\n",
       "1   United States   297.40    346.05\n",
       "2           India   210.43    238.09\n",
       "3          Russia    31.57     34.61\n",
       "4           Japan    95.94    103.09\n",
       "5         Germany   104.62    109.79\n",
       "6          Brazil    17.54     21.94\n",
       "7  United Kingdom     9.37     10.73\n",
       "8    South Africa    22.82     23.45\n",
       "9       Australia    26.22     29.64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ets_eval = []\n",
    "for country in COUNTRIES:\n",
    "    actual_holdout = (\n",
    "        base[(base[\"country\"] == country) & (base[\"year\"].between(2019, 2023))]\n",
    "        .sort_values(\"year\")[\"co2\"].values\n",
    "    )\n",
    "    pred_holdout = ets_forecasts[country][\"mean\"].loc[2019:2023].values\n",
    "    mae = mean_absolute_error(actual_holdout, pred_holdout)\n",
    "    rmse = mean_squared_error(actual_holdout, pred_holdout) ** 0.5\n",
    "    ets_eval.append({\"country\": country, \"ets_mae\": mae, \"ets_rmse\": rmse})\n",
    "\n",
    "ets_eval_df = pd.DataFrame(ets_eval)\n",
    "ets_eval_df.round(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b2e6372d",
   "metadata": {},
   "source": [
    "Merge the ETS metrics into the Week 3 comparison table to build a consolidated four-model view\n",
    "(Naive Baseline, Linear Regression, Random Forest, ETS)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "ffb2ed51",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.630073Z",
     "iopub.status.busy": "2026-07-29T14:01:51.629956Z",
     "iopub.status.idle": "2026-07-29T14:01:51.641750Z",
     "shell.execute_reply": "2026-07-29T14:01:51.641262Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Baseline MAE</th>\n",
       "      <th>LR MAE</th>\n",
       "      <th>RF MAE</th>\n",
       "      <th>ETS MAE</th>\n",
       "      <th>Baseline RMSE</th>\n",
       "      <th>LR RMSE</th>\n",
       "      <th>RF RMSE</th>\n",
       "      <th>ETS RMSE</th>\n",
       "      <th>Best Model</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>315.10</td>\n",
       "      <td>209.64</td>\n",
       "      <td>1189.23</td>\n",
       "      <td>290.50</td>\n",
       "      <td>344.12</td>\n",
       "      <td>217.08</td>\n",
       "      <td>1295.89</td>\n",
       "      <td>389.31</td>\n",
       "      <td>LR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>United States</td>\n",
       "      <td>212.54</td>\n",
       "      <td>493.51</td>\n",
       "      <td>366.32</td>\n",
       "      <td>297.40</td>\n",
       "      <td>292.33</td>\n",
       "      <td>507.53</td>\n",
       "      <td>384.40</td>\n",
       "      <td>346.05</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>India</td>\n",
       "      <td>191.84</td>\n",
       "      <td>164.68</td>\n",
       "      <td>158.78</td>\n",
       "      <td>210.43</td>\n",
       "      <td>197.19</td>\n",
       "      <td>206.60</td>\n",
       "      <td>180.75</td>\n",
       "      <td>238.09</td>\n",
       "      <td>RF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Russia</td>\n",
       "      <td>44.24</td>\n",
       "      <td>28.14</td>\n",
       "      <td>35.20</td>\n",
       "      <td>31.57</td>\n",
       "      <td>50.31</td>\n",
       "      <td>33.11</td>\n",
       "      <td>39.56</td>\n",
       "      <td>34.61</td>\n",
       "      <td>LR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Japan</td>\n",
       "      <td>36.53</td>\n",
       "      <td>73.83</td>\n",
       "      <td>102.99</td>\n",
       "      <td>95.94</td>\n",
       "      <td>39.83</td>\n",
       "      <td>78.26</td>\n",
       "      <td>105.43</td>\n",
       "      <td>103.09</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>39.59</td>\n",
       "      <td>93.51</td>\n",
       "      <td>88.09</td>\n",
       "      <td>104.62</td>\n",
       "      <td>46.43</td>\n",
       "      <td>104.04</td>\n",
       "      <td>95.59</td>\n",
       "      <td>109.79</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>19.74</td>\n",
       "      <td>61.67</td>\n",
       "      <td>17.31</td>\n",
       "      <td>17.54</td>\n",
       "      <td>26.35</td>\n",
       "      <td>68.48</td>\n",
       "      <td>21.63</td>\n",
       "      <td>21.94</td>\n",
       "      <td>RF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>18.84</td>\n",
       "      <td>20.96</td>\n",
       "      <td>41.43</td>\n",
       "      <td>9.37</td>\n",
       "      <td>23.47</td>\n",
       "      <td>23.56</td>\n",
       "      <td>42.28</td>\n",
       "      <td>10.73</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>12.27</td>\n",
       "      <td>32.18</td>\n",
       "      <td>14.73</td>\n",
       "      <td>22.82</td>\n",
       "      <td>17.08</td>\n",
       "      <td>32.90</td>\n",
       "      <td>17.68</td>\n",
       "      <td>23.45</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Australia</td>\n",
       "      <td>6.70</td>\n",
       "      <td>19.94</td>\n",
       "      <td>10.22</td>\n",
       "      <td>26.22</td>\n",
       "      <td>8.89</td>\n",
       "      <td>20.61</td>\n",
       "      <td>10.91</td>\n",
       "      <td>29.64</td>\n",
       "      <td>Baseline</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Country  Baseline MAE  LR MAE   RF MAE  ETS MAE  Baseline RMSE  \\\n",
       "0           China        315.10  209.64  1189.23   290.50         344.12   \n",
       "1   United States        212.54  493.51   366.32   297.40         292.33   \n",
       "2           India        191.84  164.68   158.78   210.43         197.19   \n",
       "3          Russia         44.24   28.14    35.20    31.57          50.31   \n",
       "4           Japan         36.53   73.83   102.99    95.94          39.83   \n",
       "5         Germany         39.59   93.51    88.09   104.62          46.43   \n",
       "6          Brazil         19.74   61.67    17.31    17.54          26.35   \n",
       "7  United Kingdom         18.84   20.96    41.43     9.37          23.47   \n",
       "8    South Africa         12.27   32.18    14.73    22.82          17.08   \n",
       "9       Australia          6.70   19.94    10.22    26.22           8.89   \n",
       "\n",
       "   LR RMSE  RF RMSE  ETS RMSE Best Model  \n",
       "0   217.08  1295.89    389.31         LR  \n",
       "1   507.53   384.40    346.05   Baseline  \n",
       "2   206.60   180.75    238.09         RF  \n",
       "3    33.11    39.56     34.61         LR  \n",
       "4    78.26   105.43    103.09   Baseline  \n",
       "5   104.04    95.59    109.79   Baseline  \n",
       "6    68.48    21.63     21.94         RF  \n",
       "7    23.56    42.28     10.73   Baseline  \n",
       "8    32.90    17.68     23.45   Baseline  \n",
       "9    20.61    10.91     29.64   Baseline  "
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "four_model_df = comparison_df.merge(\n",
    "    ets_eval_df.rename(columns={\"country\": \"Country\", \"ets_mae\": \"ETS MAE\", \"ets_rmse\": \"ETS RMSE\"}),\n",
    "    on=\"Country\",\n",
    ")\n",
    "four_model_df = four_model_df[\n",
    "    [\"Country\", \"Baseline MAE\", \"LR MAE\", \"RF MAE\", \"ETS MAE\",\n",
    "     \"Baseline RMSE\", \"LR RMSE\", \"RF RMSE\", \"ETS RMSE\", \"Best Model\"]\n",
    "]\n",
    "four_model_df.round(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "874c77d7",
   "metadata": {},
   "source": [
    "**Conclusion.** ETS(A,Ad,N) is evaluated on a genuinely harder task than the Week 3 models — a 5-step\n",
    "multi-year forecast from a single 2018 fit, rather than a 1-step-ahead prediction refreshed with each\n",
    "new year of actuals — so a direct MAE comparison should be read with that caveat in mind. Even so, ETS\n",
    "performs competitively for countries with a smooth, consistent historical trend (e.g. the steadily\n",
    "declining UK and Germany), where a damped trend model's assumptions match reality well. It performs\n",
    "comparatively worse for countries whose 2019–2023 window includes a sharp COVID-19 disruption that\n",
    "deviates from the pre-pandemic trend the model was fit on (2020 in particular was a shock no\n",
    "trend-following model could anticipate). Across all four approaches, the consistent theme is that\n",
    "CO<sub>2</sub> emissions are dominated by trend continuation, and every model beats the naive baseline\n",
    "only when it can extract genuine trend signal beyond \"next year looks like this year.\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "97c66669",
   "metadata": {},
   "source": [
    "<a id=\"week5\"></a>\n",
    "## Week 5: Scenario Analysis\n",
    "\n",
    "*Learning objective: build a what-if scenario module to simulate the emissions impact of policy\n",
    "interventions; develop skills in parameterised analysis and result interpretation.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4771bb8b",
   "metadata": {},
   "source": [
    "<a id=\"w5-1\"></a>\n",
    "### 5.1 Scenario Design\n",
    "\n",
    "- **Scenario A — Business as Usual (BAU):** no policy change; use the ETS(A,Ad,N) baseline forecast\n",
    "  from Week 4.\n",
    "- **Scenario B — Moderate Mitigation:** apply a linear annual reduction rate of 2% per year relative\n",
    "  to the 2024 emissions level, starting from 2025.\n",
    "- **Scenario C — Aggressive Mitigation:** apply a linear annual reduction rate of 5% per year relative\n",
    "  to the 2024 emissions level, starting from 2025.\n",
    "\n",
    "*These scenarios are illustrative, not scientifically calibrated — they are simple, transparent\n",
    "what-if parameterisations meant to compare relative outcomes, not to serve as policy-grade emissions\n",
    "projections. Real mitigation pathways would depend on modelled sector-by-sector policy interventions.*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ce4bb3b",
   "metadata": {},
   "source": [
    "<a id=\"w5-2\"></a>\n",
    "### 5.2 Scenario Calculation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "a180b23e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.643627Z",
     "iopub.status.busy": "2026-07-29T14:01:51.643495Z",
     "iopub.status.idle": "2026-07-29T14:01:51.657749Z",
     "shell.execute_reply": "2026-07-29T14:01:51.657280Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Saved ../data/scenario_projections.csv with shape (480, 4)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>year</th>\n",
       "      <th>scenario</th>\n",
       "      <th>co2_projected</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>China</td>\n",
       "      <td>2025</td>\n",
       "      <td>BAU</td>\n",
       "      <td>11714.178157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>China</td>\n",
       "      <td>2025</td>\n",
       "      <td>Moderate Mitigation</td>\n",
       "      <td>12043.256260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>China</td>\n",
       "      <td>2025</td>\n",
       "      <td>Aggressive Mitigation</td>\n",
       "      <td>11674.585150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>China</td>\n",
       "      <td>2026</td>\n",
       "      <td>BAU</td>\n",
       "      <td>11823.559214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>China</td>\n",
       "      <td>2026</td>\n",
       "      <td>Moderate Mitigation</td>\n",
       "      <td>11802.391135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>China</td>\n",
       "      <td>2026</td>\n",
       "      <td>Aggressive Mitigation</td>\n",
       "      <td>11090.855892</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>China</td>\n",
       "      <td>2027</td>\n",
       "      <td>BAU</td>\n",
       "      <td>11919.048528</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>China</td>\n",
       "      <td>2027</td>\n",
       "      <td>Moderate Mitigation</td>\n",
       "      <td>11566.343312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>China</td>\n",
       "      <td>2027</td>\n",
       "      <td>Aggressive Mitigation</td>\n",
       "      <td>10536.313098</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  country  year               scenario  co2_projected\n",
       "0   China  2025                    BAU   11714.178157\n",
       "1   China  2025    Moderate Mitigation   12043.256260\n",
       "2   China  2025  Aggressive Mitigation   11674.585150\n",
       "3   China  2026                    BAU   11823.559214\n",
       "4   China  2026    Moderate Mitigation   11802.391135\n",
       "5   China  2026  Aggressive Mitigation   11090.855892\n",
       "6   China  2027                    BAU   11919.048528\n",
       "7   China  2027    Moderate Mitigation   11566.343312\n",
       "8   China  2027  Aggressive Mitigation   10536.313098"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scenario_rows = []\n",
    "scenario_years = list(range(2025, 2041))\n",
    "\n",
    "for country in COUNTRIES:\n",
    "    base_2024 = base.loc[(base[\"country\"] == country) & (base[\"year\"] == 2024), \"co2\"].values[0]\n",
    "    bau_mean = ets_forecasts[country][\"mean\"]\n",
    "\n",
    "    for year in scenario_years:\n",
    "        n = year - 2024\n",
    "        scenario_rows.append({\"country\": country, \"year\": year, \"scenario\": \"BAU\",\n",
    "                               \"co2_projected\": bau_mean.loc[year]})\n",
    "        scenario_rows.append({\"country\": country, \"year\": year, \"scenario\": \"Moderate Mitigation\",\n",
    "                               \"co2_projected\": base_2024 * (1 - 0.02) ** n})\n",
    "        scenario_rows.append({\"country\": country, \"year\": year, \"scenario\": \"Aggressive Mitigation\",\n",
    "                               \"co2_projected\": base_2024 * (1 - 0.05) ** n})\n",
    "\n",
    "scenario_df = pd.DataFrame(scenario_rows)\n",
    "scenario_df.to_csv(\"../data/scenario_projections.csv\", index=False)\n",
    "print(f\"Saved ../data/scenario_projections.csv with shape {scenario_df.shape}\")\n",
    "scenario_df.head(9)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3ea37cab",
   "metadata": {},
   "source": [
    "<a id=\"w5-3\"></a>\n",
    "### 5.3 Scenario Visualisations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "ba431daa",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.659259Z",
     "iopub.status.busy": "2026-07-29T14:01:51.659137Z",
     "iopub.status.idle": "2026-07-29T14:01:51.867057Z",
     "shell.execute_reply": "2026-07-29T14:01:51.866365Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "IbByaBFno0Coxks3SXakQK5H4XqUVqVAIbByaJHEpkB56SYxyCuoQKAaL91kLqpAHVpkO59Wq0AzMzMzs3CrQOkmMQisNqpAz/dT4+W7q0CF61G4nnesQH0/NV46GK1AkxgEVi4CsEBMN4lBQOOyQHWTGAT2WrRAVg4tsv35tkDD9ShcL1a5QD81XrqpPrtAlkOLbGdEvUBWDi2yfcm+QBsv3SQG0cBAJQaBlROYwkCHFtnOpxPDQGiR7Xwva8NAf2q8dAN8w0DsUbgeBUHDQGZmZmYWCsNAEoPAygGIw0DsUbgeZTXEQLgehevB7MRAnMQgsEJIxUDZzvdTMwrGQJZDi2zn38ZA1XjpJgHGx0D6fmq8hADIQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "VdDbzRbhxkDmyVSUxxfHQGtmKzaGR8dAmkfQhzRxx0A90lavl5XHQHMe9shbtcdA65UbFRfRx0Aaxhm/TOnHQAvllElv/sdAs5sjrOIQyECR9SUs/iDIQH73jvkNL8hAflRBl1Q7yEBPv6cVDEbIQGfdWCVnT8hAjOTZBpJXyEA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "o68gzaCFx0Aqg7QQMg3HQICppvErl8ZAjOPlGoIjxkCPIYV2KLLFQH06eCwTQ8VAmRpXoTbWxEAlSCd1h2vEQL6dK4L6AsRAlRq624Scw0BqqRfNGzjDQKC/Wdi01cJArLZNtUV1wkBgwmVQxBbCQHRnq8kmusFABVa3c2NfwUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "oPgx5krNxkAyrOKNbanFQMlWlxMolMRACyw2rL+Mw0AK3ZnjgpLCQMpeBSXJpMFA2eaRSfLCwECcNpVYzNi/QHmNWocoQb5AZwaWgOa9vEAUho5gAU67QCzM7U6B8LlAxE7I13qkuEDTSv5MDmm3QHstiy9nPbZAm9FdoLsgtUA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 2483.534,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 2483.534,
          "y1": 2483.534,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: China"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "QmDl0MILtEA/NV66adSzQOxRuB7FOrRA7FG4HoWftEBzaJHt3PG0QMHKoUXWMbVA001iEBjhtUCgGi/dJCm2QI/C9ShcaLZALbKd70eotkDFILByKIe3QFpkO9+PD7dAbef7qdE7t0A9CtejcHa3QFK4HoWL37dASgwCK+fut0B/arx0U523QG8Sg8CK6bdAarx0kzgft0DJdr6fGm61QAAAAABAJbZAAiuHFvmitUA730+Nd9O0QA4tsp1vYbVA9ihcj2KbtUAdWmQ7f/i0QCcxCKxcfbRAbxKDwGpLtEDb+X5qPPG0QPT91Hjpc7RAYhBYOfRRskDb+X5qHJyzQEoMAitnv7NAeekmMWg2s0CF61G4HiizQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "KHVy11yJtEBJft3lXYW0QJes12LkgbRAhD3E5t5+tEDIFTZPPny0QP2LIHP1ebRAwajr4Ph3tEDnqCGlPna0QFCglhi+dLRAKJAQtW9ztEBx1JbvTHK0QLAerBdQcbRAp9POOnRwtEDeC7ELtW+0QJsVrMwOb7RA1IcDPX5utEA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "VFInoAnGskBn74y26mWyQJ3qVvC3B7JAcdHFdWersUBATX+h71CxQKAdjP9G+LBAwTtbTGShsEB6DMpzPkywQDgOYyCZ8a9ANm/w0gtOr0CXBlLow62uQGovHaGwEK5AbNemk8F2rUD0dkyq5t+sQL3QxSEQTKxAj0x/hy67q0A=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "i2zn++kyskC3QILi90mxQBRXlX2rbLBADL+bbt80r0CxKEfcbaWtQHUz3Sr1KaxASFeFtXXBqkDrEqWf/GqpQF44QzGjJahAjXWZO47wpkDfYmuF7cqlQO2dvz77s6RAoW+ce/uqo0DZNm61O6+iQLRNwlISwKFAa2MFNd7coEA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 5131.761,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 5131.761,
          "y1": 5131.761,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: United States"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "N4lBYOUPgkDJdr6fGjuDQAisHFpke4RAarx0kxgqhUDTTWIQWFCGQKRwPQrXw4dAiUFg5dC8iUArhxbZzs+KQCUGgZVDXotAZDvfT40JjkDsUbgehdiOQN0kBoGVSY9AAAAAAAAjkEA730+Nl7GQQG3n+6lxupFAUI2XbpKtkkAQWDm0SDWUQD0K16PwxZVAWDm0yHZJl0BaZDvfTzWZQIXrUbgeOppA4XoUrseWm0Bt5/up8RueQAIrhxZZLZ9AyXa+nxrIoECq8dJNom+hQK5H4XoUYaJAbef7qXHzokBiEFg5dEakQJqZmZlZZqRAWDm0yHbtokCTGARWjuekQCUGgZVDHqZAjZduEoPtp0D6fmq89PKoQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "ZEPj7iqSqkBUfp2A6XmrQDeDVXB/YKxAt/i7Oe5FrUCshJtWNyquQCo62z5cDa9AggSBaF7vr0CQB9qjH2iwQCqVXycA2LBAiZYJd1FHsUDSqSRKFLaxQKbNEldJJLJAdo1MU/GRskBQLGLzDP+yQDXO/Oqca7NA8J/f7KHXs0A=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "KJtyhTdzqEC737JUCPanQJSTkBVae6dATthp9h8Dp0CfxD5nTY2mQElaYRjWGaZApDQs+a2opUAwzb82yTmlQJs0xjoczaRAEh89qptipECSI0ZkPPqjQGAO/YDzk6NAsCdUULYvo0DaT/ZYes2iQGHTLlc1baJAY9nWO90OokA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "bcX+spuzp0BbCHJQOoSmQCO70jIEZKVAxzFIMDdSpECwlUTUGk6jQM0nQeP/VqJAAxmx5D9soUBccduyPI2gQPvwoCDAcp9AvLFlhTbgnUALnCBlzWGcQNctEiCD9ppAJkUR+GKdmUCwAaprhFWYQDQbe5kKHpdApCZoqyP2lUA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 577.987,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 577.987,
          "y1": 577.987,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: India"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "IbByaJHQo0AQWDm0SM+iQEa28/3UrZ5AmpmZmRkqnUAv3SQGgbuZQKAaL90kSZlAeekmMYjKmEBg5dAi2yeXQA4tsp1v55ZAMQisHFpYl0D8qfHSTSKXQOf7qfFSuJdAuB6F61GRl0AbL90kBgyYQPT91HhpJZhAUrgehetvmEDByqFFtl2ZQPYoXI9CYZlAgZVDi+zSmUBt5/up8SSYQAwCK4eWhJlA+n5qvPRTmkAj2/l+apCaQKabxCAwlplAObTIdj6VmUDl0CLb+YyZQFpkO99PdZlANV66SQz0mUBxPQrXo7eaQHWTGATWoZpA+FPjpZt/mUBqvHSTGCqaQNNNYhDYLZpA16NwPYoUm0BqvHSTGNKbQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "fI8LhsfGmkB0TGpFbs+aQNMWthFa1ppAubjygePbmkBxbVZ1UeCaQAT+cp7c45pAej7wWLLmmkDYPiHu9uiaQIqle2XH6ppAGF4q+DrsmkCKvk86ZO2aQLEL1AhS7ppAa0mkRxDvmkDMeuR5qO+aQBpvsTsi8JpA8piIo4PwmkA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "93DJcadDm0AbVZedD7iaQKTd1oBCL5pAfbou0DGpmUBSeXWJzyWZQO/NOvINpZhALVlYlt8mmEAIyIlGN6uXQE8lDBcIMpdACjlEXkW7lkCA0Wuz4kaWQG7SRe3T1JVA0ufYIA1llUA5ujCggveUQE2DJfkojJRA9OEp9PQilEA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "y39Iv/1tmkCarFEPsRuZQPhjWptO2pdAxati4P2olkAuI8Qu8YaVQAW7oB9lc5RAERg/EaBtk0B38Pup8XSSQHAkfGGyiJFABYnPD0OokECIt3AEGaaPQPRHnir+EI5AW8R8qCSQjECJuqk5iSKLQAI+YZA1x4lAgZSPrz99iEA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 2536.284,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 2536.284,
          "y1": 2536.284,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: Russia"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "9P3UeGkLkkCR7Xw/NTqSQIlBYOXQXZJAWmQ7309FkkASg8DKoRyTQKJFtvN9T5NA9ihcj8KCk0BSuB6F62OTQHWTGARWxZJARIts53tYk0BaZDvfz7CTQArXo3C9d5NASOF6FK7tk0B7FK5HYQ+UQHNoke18/JNAz/dT46UZlED2KFyPwr2TQDeJQWDlS5RAaJHtfL8yk0CNl24SAyGSQI/C9Shc7JJATmIQWLm0k0DLoUW2c1iUQC/dJAaBf5RADAIrhxaxk0CwcmiR7Q+TQKwcWmS7v5JAIbByaJGBkkAzMzMzM8qRQJhuEoNAOJFAcT0K1yM1kEBeukkMAoqQQK5H4XqUFpBA4XoUrkfXjkAOLbKd7w6OQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "RRyqLSLMkUC4vU6FQsyRQEualItdzJFAAidTIHTMkUDcy5P+hsyRQF0Zn8KWzJFAEUQL76PMkUAGyPXwrsyRQHUziyO4zJFAkVb60r/MkUCgR+s+xsyRQBSmjpzLzJFA3CtWGNDMkUAZzmTX08yRQHBWwvjWzJFAvmhcltnMkUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "y5wuiwl1jUB1ZsxuN96MQFO2LoZpSoxAcKioX5C5i0AxKqDYnCuLQBsf+RuAoIpAfJ6IoCsYikBvIJAnkZKJQLVxQLuiD4lAeEZErVKPiEAQRVKVkxGIQGZixk9YlodAq2pC/JMdh0B+kVX8OaeGQKHlKvI9M4ZA34Q+v5PBhUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "Z0RpbzCOjEDIzXADriCLQBdd3hxyxYlAogugzpJ7iEDZ1+TdMUKHQHUzZix8GIZAFeQtKqn9hEB6ZXhO+vCDQM3GWJe68YJAqonHDz7/gUBhXMpb4RiBQI+kZkoJPoBA3Gsp2kTcfkDdjNpoQVF9QDhsnCP+2XtAmzNuO351ekA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 1154.853,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 1154.853,
          "y1": 1154.853,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: Japan"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "d76fGi97kEA9CtejcMePQMHKoUW2S45ADAIrhxb7jUDn+6nx0nmNQLbz/dR4X41A7FG4HoX9jUDy0k1iEByNQKJFtvP924xAqMZLN4n7i0ArhxbZzheMQNejcD0KmoxA6SYxCKwWjEBeukkMAvSLQMP1KFyPZItA16NwPQofi0C28/3UeLOLQE5iEFg5cYpAoBov3STFikAdWmQ736+IQHE9Ctej1YlAdZMYBFYkiUA5tMh2vnCJQIcW2c73/YlA6SYxCKzEiEDdJAaBlQaJQJZDi2zn74hA9ihcj8KEiEC6SQwCK7aHQNV46SYxJYZAI9v5fmo5hEBEi2zn+y+FQDm0yHa+3oRA46WbxCCOgkBkO99PjeKBQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "upDPleNMh0BZ6DdDxCuHQGivDLSuC4dABAPnk5rshkCFuTXRf86GQHcfJZtWsYZAVIOXXxeVhkAyCS7JunmGQMRDYb05X4ZAFBSpWo1FhkB4VbP2riyGQPbeqByYFIZAHWeAi0L9hUDp2l40qOaFQMq7BDnD0IVAQxxI6o27hUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "r84xIPuGgUAwu4LIPS2BQBUoV+hL1YBAhbE2Txx/gEB+mbX7pSqAQHHGBzXAr39A6n8CC4QNf0DgaKuFhm5+QNG9HQi30n1A8IuDSgU6fUAaMmJYYaR8QH+X7467EXxAgetvmwSCe0D0wpt5LfV6QAVoDnIna3pAvDK8GOTjeUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "n6ut2J/9gEBwyXGnJCSAQO4xWHESq35Aby96uIQifUBC4ECvl617QAzVsBlQS3pAyjCbS7/6eEBabtOHArt3QG5Cb2dCi3ZAULKpSLJqdUCYnAfFj1h0QMPUYC4iVHNA7ZZ1ErpcckCUgrzEsHFxQAx8Ge5nknBA455jRJJ8b0A=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 1054.796,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 1054.796,
          "y1": 1054.796,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: Germany"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "kxgEVg5Va0D4U+Olm6xsQKwcWmQ7M21AbxKDwMqJbkDy0k1iEMBvQAIrhxbZynBA5dAi2/kUckB3vp8aLy9zQDm0yHa+1XNAarx0kxh0dECwcmiR7UJ1QC2yne+nonVACtejcD28dUC4HoXrUYp1QG3n+6nxlnZADi2yne/FdkAOLbKd7w13QLpJDAIraXhAke18PzXKeUBmZmZmZlx4QPyp8dJNhHtAf2q8dJPefEBzaJHtfBd/QGQ730+NnIBAke18PzVkgUAIrBxaZIGAQFK4HoXru35ArkfhehQUf0BWDi2yncl9QN0kBoGVy31ARIts5/v/e0CiRbbz/Qh/QLByaJHtAH5AHVpkO98/fkDVeOkmMTB+QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "ERL7UHQPgEBaSAnZKTWAQEdUe1O+WYBAyh4CaDp9gEDYifZ7pp+AQLv8VbQKwYBAR7av927hgECEWQPw2gCBQCMmkQxWH4FAhEqcg+c8gUDpuR9UllmBQB7udUdpdYFA6/jz8maQgUCLRni5laqBQH1v7cz7w4FAQnXBL5/cgUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "qAAYz6CVfUBcHzHVJ/58QMZ1aGW2aXxA0dn6/DzYe0AQb49orEl7QI8LocL1vXpAh77vcQo1ekAyT/on3K55QA2Lf99cK3lAeDsH236qeECQm3KjNCx4QM8nlAZxsHdA5KHOFSc3d0DGI7skSsB2QPAd1sfNS3ZAVh0z06XZdUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "ZMxdS8itfED4Tsx6sT57QGux22f14XlA8k6qIqmWeEBlMYh67Vt3QLr7mmfuMHZAI28GfOIUdUD7TzlcCgd0QC4/Az6wBnNAOa8cbicTckBCc87byytxQBiHaqoBUHBA4TOXkGn+bkAWPikWsXFtQGFh2qHO+GtAgtz1TMSSakA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 218.658,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 218.658,
          "y1": 218.658,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: Brazil"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "w/UoXI/PgkD8qfHSTQuDQFTjpZvEjoJAlkOLbOccgkBCYOXQIvCBQIPAyqFFsYFADAIrhxZWgkCLbOf7qZWBQDEIrBxaxIFAMzMzMzONgUCDwMqhRciBQFTjpZvED4JAd76fGi+CgUDLoUW289yBQD0K16Nw64FAYhBYObTSgUBU46WbxL6BQEoMAiuHfIFA+n5qvHQHgUB9PzVeuuF+QBSuR+F6/n9AxSCwcmhbfUASg8DKoXd+QLKd76fG2X1A9P3UeOlse0BMN4lBYGd6QHsUrkfh9nhAHVpkO981eEBI4XoUrrt3QDVeukkMzHZAke18PzVkdEBg5dAi22V1QNnO91PjcXNA8KfGSzc9c0DRItv5fo5zQA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "p/Lo8bgncUB20ryiQVhwQK2teQaqG29AdBKba6eQbUC1XOo/Pg9sQO6kO8syl2pAjKvpyEooaUA/g85eTcJnQIhmdBQDZWZAIFt9yjUQZUA8TkCysMNjQANdmkVAf2JArQTzPrJCYUCT/XGR1Q1gQGQYy8L0wF1AWDWw+eN0W0A=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "uDtrt10qc0ClP0UfPchyQOSpkPASaHJAnSv0HtUJckAQ44jRea1xQADz0mH3UnFAyF6/WkT6cEAVEKd3V6NwQOzrVqMnTnBA7Lk57lf1b0Cmc7Nzt1FvQNrcL75csW5AHaBNDDcUbkBuCHXyNXptQLTFIFlJ42xAEXove2FPbEA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "E2HD0yuUckA5nPnVXKZxQM+6RstxxHBAI5Y5AqXbb0BsGx3C3ENuQA7azh54wGxAWYJEHXJQa0BuFQHP0vJpQFvUDauupmhAVyNN7yVrZ0Ase7wJZD9mQGnbPwmfImVApEOWFRcUZEAOjRvuFRNjQM2SAG/uHmJA3PGmHPw2YUA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 601.945,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 601.945,
          "y1": 601.945,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: United Kingdom"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "bef7qfGOc0AUrkfhemB0QCUGgZVD1XJAz/dT46UFdEDwp8ZLNyt1QAisHFpkm3ZAwcqhRba7dkA9CtejcBN4QO58PzVelHdAlkOLbOdtd0AX2c73U6V3QBKDwMqhOXdAvHSTGARIdkDRItv5fkZ5QP7UeOkmFXxA4XoUrkcDekCWQ4ts5+t7QAaBlUOLEH1AVOOlm8TqfkDVeOkmMah9QM/3U+OlNX1A7nw/NV6kfUBeukkMAtd8QF66SQwCg3xAke18PzUafkAhsHJokZd8QM3MzMzMkHxAXI/C9SiAe0DHSzeJQVx8QBKDwMqha31AVOOlm8Q0e0CBlUOLbHd7QI2XbhKDzHpAi2zn+6lJe0Ce76fGS317QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "K0vXzV4ZfUAbxw+IqzF9QOPHxLCxSH1AaJrGbIJefUAbdn/6LXN9QDLcC77Dhn1AHmqwTFKZfUDep7V356p9QPHnsVaQu31ANOJIUVnLfUDKS2goTtp9QN1MCP956H1AYVh2Yuf1fUCOkjBSoAJ+QNCfV0euDn5AIWe8OxoafkA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "L/oK0ozwekCpCex7nmZ6QKo8uVpy33lA0EqrTvpaeUDWtEuAKNl4QCSDAl/vWXhACWyrn0Hdd0DLOzI7EmN3QFJZNm1U63ZADUO1svt1dkBu4LvI+wJ2QOaEHqtIknVAPoI3k9YjdUCYKKz2mbd0QE4TOIaHTXRAR6J+LJTlc0A=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "CYofY24dekAiwyreKM94QGA5QgaakXdAToNY7OtjdkC9fLpTU0V1QOZcJCkPNXRAQVivAGgyc0BxLUCarzxyQF5eI2xAU3FADQCIM311cEAXABwVoUVvQBUAQQdZtW1AR/OwkxQ5bEC3gE6M089qQK1gF5KieGlACs8vcZoyaEA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 312.934,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 312.934,
          "y1": 312.934,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: South Africa"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "line": {
          "color": "lightgray",
          "width": 3
         },
         "mode": "lines",
         "name": "Historical actual (1990-2024)",
         "type": "scatter",
         "x": {
          "bdata": "xgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoBw==",
          "dtype": "i2"
         },
         "y": {
          "bdata": "5dAi2/lgcUCiRbbz/XZxQLByaJHtxnFAFK5H4XoMckArhxbZzllyQAisHFpkD3NAVg4tsp19c0DZzvdT4wN0QPhT46Wb4HRAvHSTGAR+dUDufD81Xt51QKabxCCwWnZAzczMzMymdkAGgZVDiyx3QK5H4XoU4HdAWmQ7308ReECHFtnO93V4QHWTGARW7nhAWDm0yHZEeUASg8DKoW95QCPb+X5qUHlARIts5/s9eUCuR+F6FFB5QJqZmZmZ3XhA9ihcj8KJeECBlUOLbAl5QC2yne+nmnlASgwCK4fWeUDRItv5fux5QM3MzMzM7nlAmG4Sg8DoeEBkO99PjUd4QGiR7Xw/AXhAkxgEVg4FeEDByqFFtit4QA==",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#1f77b4",
          "width": 2.5
         },
         "mode": "lines",
         "name": "BAU",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "m0TG3vmYekATbbpaIah6QHFQx4+jtXpA1zIgPa7BekAwTT0qasx6QGQC9bD71XpAjgqWOIPeekCqdqOjHeZ6QDwqprHk7HpAwA1fVu/yekDqQ4EHUvh6QNCa+wEf/XpA1dy7h2YBe0A2Kr0WNwV7QLTNG5qdCHtAor/UlaULe0A=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#ff7f0e",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "a2XCL/Wvd0DpTgu5rTZ3QM/hVzXTv3ZAA3xlOVlLdkB0S4eZM9l1QLS/YGhWaXVAbn6m9bX7dEBXueXMRpB0QP7EUbT9JnRAadCXq8+/c0AqnrjqsVpzQB8g6OCZ93JAzNdyM32WckC43ai8UTdyQONyzooN2nFA8/8R36Z+cUA=",
          "dtype": "f8"
         }
        },
        {
         "line": {
          "color": "#2ca02c",
          "width": 2.5
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "y": {
          "bdata": "ak3zjlP2dkC/vAD7aNB1QBuADYgwuXRAGaDZGu6vc0AXWOj/7rNyQBa6HHOJxHFAYUpbLRzhcECphuP3DQlwQKhMMIqad25AoBXhnJ/xbEBXoaJuJH9rQKx/GmkvH2pASfmlcNPQaEDSrJ1EL5NnQJTKledsZWZAprM0D8FGZUA=",
          "dtype": "f8"
         }
        }
       ],
       "layout": {
        "annotations": [
         {
          "showarrow": false,
          "text": "1990 level (policy benchmark)",
          "x": 0,
          "xanchor": "left",
          "xref": "x domain",
          "y": 278.061,
          "yanchor": "bottom",
          "yref": "y"
         }
        ],
        "legend": {
         "orientation": "h",
         "y": -0.2
        },
        "shapes": [
         {
          "line": {
           "color": "black",
           "dash": "dash"
          },
          "type": "line",
          "x0": 0,
          "x1": 1,
          "xref": "x domain",
          "y0": 278.061,
          "y1": 278.061,
          "yref": "y"
         }
        ],
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Emissions Scenarios, 2020-2040: Australia"
        },
        "xaxis": {
         "range": [
          2020,
          2040
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def plot_country_scenarios(country):\n",
    "    hist = base[(base[\"country\"] == country) & (base[\"year\"].between(1990, 2024))].sort_values(\"year\")\n",
    "    level_1990 = base.loc[(base[\"country\"] == country) & (base[\"year\"] == 1990), \"co2\"].values[0]\n",
    "\n",
    "    fig = go.Figure()\n",
    "    fig.add_trace(go.Scatter(x=hist[\"year\"], y=hist[\"co2\"], name=\"Historical actual (1990-2024)\",\n",
    "                              mode=\"lines\", line=dict(color=\"lightgray\", width=3)))\n",
    "    for scen, color in SCENARIO_COLORS.items():\n",
    "        s = scenario_df[(scenario_df[\"country\"] == country) & (scenario_df[\"scenario\"] == scen)].sort_values(\"year\")\n",
    "        fig.add_trace(go.Scatter(x=s[\"year\"], y=s[\"co2_projected\"], name=scen,\n",
    "                                  mode=\"lines\", line=dict(color=color, width=2.5)))\n",
    "    fig.add_hline(y=level_1990, line_dash=\"dash\", line_color=\"black\",\n",
    "                  annotation_text=\"1990 level (policy benchmark)\", annotation_position=\"top left\")\n",
    "    fig.update_layout(title=f\"Emissions Scenarios, 2020-2040: {country}\", xaxis_title=\"Year\",\n",
    "                       yaxis_title=\"CO2 Emissions (Mt)\", template=\"plotly_white\",\n",
    "                       legend=dict(orientation=\"h\", y=-0.2))\n",
    "    fig.update_xaxes(range=[2020, 2040])\n",
    "    return fig\n",
    "\n",
    "\n",
    "for country in COUNTRIES:\n",
    "    plot_country_scenarios(country).show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "53e25fd6",
   "metadata": {},
   "source": [
    "Aggregate the per-country scenario projections into a single global view, summing all 10 countries\n",
    "under each scenario."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "41bc2405",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.868718Z",
     "iopub.status.busy": "2026-07-29T14:01:51.868554Z",
     "iopub.status.idle": "2026-07-29T14:01:51.904323Z",
     "shell.execute_reply": "2026-07-29T14:01:51.903804Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "Scenario=Aggressive Mitigation<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "Aggressive Mitigation",
         "line": {
          "color": "#2ca02c",
          "dash": "solid",
          "width": 3
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Aggressive Mitigation",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "sb/snmh+10CCHJQwsFHWQBUb8/oANNVA7YwAiJok1EAUuTMBxiLTQGyJV7TVLdJAJ1yGniRF0UBYpP/8FWjQQHLrGMcpLM9AeqxXsCedzUBzfYbnGCLMQGAqJg/+ucpA20FkjuRjyUBdC6zt5R7IQDFxYzsn6sZAIUVreNjExUA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Scenario=BAU<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "BAU",
         "line": {
          "color": "#1f77b4",
          "dash": "solid",
          "width": 3
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "BAU",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "vbeSm6EM2UCTKlkrA0LZQK5d9qzTc9lAqSpT+IWi2UCcLAftfc7ZQJoO/mwS+NlA1bS5Eo8f2kAvzLGsNUXaQNlJ8oU/adpAO2jwgt6L2kASSpAYPq3aQLKcfSKEzdpAuXtBndHs2kA7luJHQwvbQCkOVjDyKNtAr02ULfRF20A=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "hovertemplate": "Scenario=Moderate Mitigation<br>Year=%{x}<br>CO2 Emissions (Mt)=%{y}<extra></extra>",
         "legendgroup": "Moderate Mitigation",
         "line": {
          "color": "#ff7f0e",
          "dash": "solid",
          "width": 3
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Moderate Mitigation",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": {
          "bdata": "6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Ac=",
          "dtype": "i2"
         },
         "xaxis": "x",
         "y": {
          "bdata": "p1zhXVY82ECjfs0oQMDXQKDntEalRtdA1Ia7AnnP1kCo7xPprlrWQOdBssU66NVAd7sFoxB41UBQ0bjIJArVQGiud7prntRAt/e8Nto01EBTtaQ1Zc3TQA5BxecBaNNA6hsOtaUE00D+i6w7RqPSQFzl9U7ZQ9JAxGBX9lTm0UA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "Scenario"
         },
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Global Aggregate Emissions Scenarios (Sum of All 10 Countries), 2025-2040"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Year"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "CO2 Emissions (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "global_scenario = scenario_df.groupby([\"scenario\", \"year\"])[\"co2_projected\"].sum().reset_index()\n",
    "\n",
    "fig = px.line(\n",
    "    global_scenario, x=\"year\", y=\"co2_projected\", color=\"scenario\",\n",
    "    title=\"Global Aggregate Emissions Scenarios (Sum of All 10 Countries), 2025-2040\",\n",
    "    labels={\"co2_projected\": \"CO2 Emissions (Mt)\", \"year\": \"Year\", \"scenario\": \"Scenario\"},\n",
    "    color_discrete_map=SCENARIO_COLORS,\n",
    ")\n",
    "fig.update_traces(line_width=3)\n",
    "fig.update_layout(template=\"plotly_white\")\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ed50bf3",
   "metadata": {},
   "source": [
    "<a id=\"w5-4\"></a>\n",
    "### 5.4 Impact Summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "db442d65",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.905980Z",
     "iopub.status.busy": "2026-07-29T14:01:51.905837Z",
     "iopub.status.idle": "2026-07-29T14:01:51.943425Z",
     "shell.execute_reply": "2026-07-29T14:01:51.943003Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "alignmentgroup": "True",
         "hovertemplate": "Scenario=Aggressive Mitigation<br>Country=%{x}<br>Cumulative CO2 (Mt)=%{y}<extra></extra>",
         "legendgroup": "Aggressive Mitigation",
         "marker": {
          "color": "#2ca02c",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Aggressive Mitigation",
         "offsetgroup": "Aggressive Mitigation",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "Australia",
          "Brazil",
          "China",
          "Germany",
          "India",
          "Japan",
          "Russia",
          "South Africa",
          "United Kingdom",
          "United States"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "Ftao0eURsECKRIPQFRK0QKGEDXFc6v9AsAYXxRjIt0DTn/hxXZbgQNcm+pf5+8NAjF/dXh9/0kCZCbNIvkayQHQzYi8iAapARinMFgF56UA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "hovertemplate": "Scenario=BAU<br>Country=%{x}<br>Cumulative CO2 (Mt)=%{y}<extra></extra>",
         "legendgroup": "BAU",
         "marker": {
          "color": "#1f77b4",
          "pattern": {
           "shape": ""
          }
         },
         "name": "BAU",
         "offsetgroup": "BAU",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "Australia",
          "Brazil",
          "China",
          "Germany",
          "India",
          "Japan",
          "Russia",
          "South Africa",
          "United Kingdom",
          "United States"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "DvvbmfngukAM+iVtVgbBQIh9E4bq0wdBduNKPF51xkAyrdxgLJrwQNfbDlWgzNFA5mK4H+bk2kDYoni/tqm9QA3ZOt0ObqdAGJdGp9Z39EA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "hovertemplate": "Scenario=Moderate Mitigation<br>Country=%{x}<br>Cumulative CO2 (Mt)=%{y}<extra></extra>",
         "legendgroup": "Moderate Mitigation",
         "marker": {
          "color": "#ff7f0e",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Moderate Mitigation",
         "offsetgroup": "Moderate Mitigation",
         "orientation": "v",
         "showlegend": true,
         "textposition": "auto",
         "type": "bar",
         "x": [
          "Australia",
          "Brazil",
          "China",
          "Germany",
          "India",
          "Japan",
          "Russia",
          "South Africa",
          "United Kingdom",
          "United States"
         ],
         "xaxis": "x",
         "y": {
          "bdata": "El0YKv9xtEAseF6wCom5QGitpO51TQRBXPB2/bZBvkAXK8T5hxrlQAgzQlnpbMlABD3VF12I10DUfB5IokC3QLFnjpjXirBAB/T/1D408EA=",
          "dtype": "f8"
         },
         "yaxis": "y"
        }
       ],
       "layout": {
        "barmode": "group",
        "legend": {
         "title": {
          "text": "Scenario"
         },
         "tracegroupgap": 0
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0.0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1.0,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0.0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1.0,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Cumulative CO2 Emissions by Country and Scenario, 2025-2040"
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0.0,
          1.0
         ],
         "tickangle": -30,
         "title": {
          "text": "Country"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0.0,
          1.0
         ],
         "title": {
          "text": "Cumulative CO2 (Mt)"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cumulative_df = (\n",
    "    scenario_df.groupby([\"country\", \"scenario\"])[\"co2_projected\"]\n",
    "    .sum()\n",
    "    .reset_index()\n",
    "    .rename(columns={\"co2_projected\": \"cumulative_co2_2025_2040\"})\n",
    ")\n",
    "\n",
    "fig = px.bar(\n",
    "    cumulative_df, x=\"country\", y=\"cumulative_co2_2025_2040\", color=\"scenario\",\n",
    "    barmode=\"group\",\n",
    "    title=\"Cumulative CO2 Emissions by Country and Scenario, 2025-2040\",\n",
    "    labels={\"cumulative_co2_2025_2040\": \"Cumulative CO2 (Mt)\", \"country\": \"Country\", \"scenario\": \"Scenario\"},\n",
    "    color_discrete_map=SCENARIO_COLORS,\n",
    ")\n",
    "fig.update_layout(template=\"plotly_white\", xaxis_tickangle=-30)\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b9f97fd2",
   "metadata": {},
   "source": [
    "Pivot the cumulative totals to compute each country's absolute avoided emissions under aggressive\n",
    "mitigation relative to business as usual, and rank countries by that savings figure."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "d8f2b132",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-07-29T14:01:51.947775Z",
     "iopub.status.busy": "2026-07-29T14:01:51.947598Z",
     "iopub.status.idle": "2026-07-29T14:01:51.959494Z",
     "shell.execute_reply": "2026-07-29T14:01:51.959033Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>scenario</th>\n",
       "      <th>Aggressive Mitigation</th>\n",
       "      <th>BAU</th>\n",
       "      <th>Moderate Mitigation</th>\n",
       "      <th>Absolute Savings (BAU - Aggressive)</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>country</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>China</th>\n",
       "      <td>130725.8</td>\n",
       "      <td>195197.3</td>\n",
       "      <td>166318.7</td>\n",
       "      <td>64471.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>India</th>\n",
       "      <td>33970.9</td>\n",
       "      <td>68002.8</td>\n",
       "      <td>43220.2</td>\n",
       "      <td>34031.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United States</th>\n",
       "      <td>52168.0</td>\n",
       "      <td>83837.4</td>\n",
       "      <td>66371.9</td>\n",
       "      <td>31669.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Russia</th>\n",
       "      <td>18940.5</td>\n",
       "      <td>27539.6</td>\n",
       "      <td>24097.5</td>\n",
       "      <td>8599.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Japan</th>\n",
       "      <td>10231.9</td>\n",
       "      <td>18226.5</td>\n",
       "      <td>13017.8</td>\n",
       "      <td>7994.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Germany</th>\n",
       "      <td>6088.1</td>\n",
       "      <td>11498.7</td>\n",
       "      <td>7745.7</td>\n",
       "      <td>5410.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Brazil</th>\n",
       "      <td>5138.1</td>\n",
       "      <td>8716.7</td>\n",
       "      <td>6537.0</td>\n",
       "      <td>3578.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>South Africa</th>\n",
       "      <td>4678.7</td>\n",
       "      <td>7593.7</td>\n",
       "      <td>5952.6</td>\n",
       "      <td>2915.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Australia</th>\n",
       "      <td>4113.9</td>\n",
       "      <td>6881.0</td>\n",
       "      <td>5234.0</td>\n",
       "      <td>2767.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>United Kingdom</th>\n",
       "      <td>3328.6</td>\n",
       "      <td>2999.0</td>\n",
       "      <td>4234.8</td>\n",
       "      <td>-329.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "scenario        Aggressive Mitigation       BAU  Moderate Mitigation  \\\n",
       "country                                                                \n",
       "China                        130725.8  195197.3             166318.7   \n",
       "India                         33970.9   68002.8              43220.2   \n",
       "United States                 52168.0   83837.4              66371.9   \n",
       "Russia                        18940.5   27539.6              24097.5   \n",
       "Japan                         10231.9   18226.5              13017.8   \n",
       "Germany                        6088.1   11498.7               7745.7   \n",
       "Brazil                         5138.1    8716.7               6537.0   \n",
       "South Africa                   4678.7    7593.7               5952.6   \n",
       "Australia                      4113.9    6881.0               5234.0   \n",
       "United Kingdom                 3328.6    2999.0               4234.8   \n",
       "\n",
       "scenario        Absolute Savings (BAU - Aggressive)  \n",
       "country                                              \n",
       "China                                       64471.5  \n",
       "India                                       34031.9  \n",
       "United States                               31669.4  \n",
       "Russia                                       8599.1  \n",
       "Japan                                        7994.6  \n",
       "Germany                                      5410.6  \n",
       "Brazil                                       3578.6  \n",
       "South Africa                                 2915.0  \n",
       "Australia                                    2767.1  \n",
       "United Kingdom                               -329.5  "
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pivot = cumulative_df.pivot(index=\"country\", columns=\"scenario\", values=\"cumulative_co2_2025_2040\")\n",
    "pivot[\"Absolute Savings (BAU - Aggressive)\"] = pivot[\"BAU\"] - pivot[\"Aggressive Mitigation\"]\n",
    "pivot.sort_values(\"Absolute Savings (BAU - Aggressive)\", ascending=False).round(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "caa63c0f",
   "metadata": {},
   "source": [
    "**Interpretation.** In absolute terms, the largest emitters — China, the United States, and India —\n",
    "benefit most from aggressive mitigation, since a 5% annual reduction applied to a much larger baseline\n",
    "yields the largest absolute avoided emissions over 2025–2040, even though the *percentage* reduction is\n",
    "identical for every country by construction. Smaller emitters among the 10 (South Africa, Australia,\n",
    "Brazil) still see meaningful proportional benefits, but their absolute cumulative savings are naturally\n",
    "smaller. This illustrates a general point about global mitigation policy: because a handful of large\n",
    "emitters dominate total emissions, the absolute climate impact of a given percentage-reduction\n",
    "commitment depends heavily on which countries adopt it, not just how ambitious the percentage is."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "561c387a",
   "metadata": {},
   "source": [
    "<a id=\"week6\"></a>\n",
    "## Week 6: Conclusions and Limitations\n",
    "\n",
    "*Learning objective: finalise the notebook to professional documentation standards and consolidate\n",
    "the project's findings.*\n",
    "\n",
    "**Key takeaways across the project:**\n",
    "\n",
    "1. **EDA (Week 1):** Global CO<sub>2</sub> emissions have risen substantially since 1990, driven\n",
    "   largely by China's and India's growth, while a subset of developed economies (UK, Germany) have\n",
    "   achieved sustained absolute reductions. CO<sub>2</sub> dominates the total GHG mix relative to\n",
    "   methane and nitrous oxide across every decade studied.\n",
    "2. **Feature Engineering (Week 2):** Lag, rolling-mean, and growth-rate features derived from the raw\n",
    "   annual series give supervised models direct access to the autocorrelation and trend structure that\n",
    "   drives emissions from one year to the next.\n",
    "3. **Baseline ML (Week 3):** A naive no-change model is a strong benchmark; Linear Regression trained\n",
    "   per country improves on it modestly for countries with a stable trend, while a pooled Random Forest\n",
    "   trades per-country specificity for larger effective sample size. The exercise reinforces that model\n",
    "   complexity must be matched to data availability.\n",
    "4. **ETS Forecasting (Week 4):** Holt's damped trend method produces physically sensible, uncertainty-\n",
    "   aware long-range forecasts to 2043, with the damping parameter capturing each country's\n",
    "   deceleration or continued momentum, and widening confidence intervals correctly signalling growing\n",
    "   uncertainty over the 20-year horizon.\n",
    "5. **Scenario Analysis (Week 5):** Simple linear mitigation scenarios (2%/year and 5%/year reductions)\n",
    "   show that the absolute climate benefit of a mitigation commitment scales with a country's baseline\n",
    "   emissions — the largest emitters offer the largest absolute avoided-emissions opportunity.\n",
    "\n",
    "**Limitations:**\n",
    "\n",
    "- The 10-country scope, while diverse, excludes many other significant emitters and does not\n",
    "  generalise globally without re-fitting.\n",
    "- All models are trained on annual, country-level aggregates and cannot capture sub-annual or\n",
    "  sub-national dynamics (e.g. seasonal energy demand, regional policy variation).\n",
    "- The Week 3 regression models and Week 4 ETS model are not evaluated on a strictly like-for-like\n",
    "  basis (1-step-ahead refreshed forecasts vs. a single multi-step forecast), so comparisons across the\n",
    "  four-model table should be read as directional, not a strict leaderboard.\n",
    "- The Week 5 mitigation scenarios are illustrative linear reduction paths, not outputs of a calibrated\n",
    "  policy or economic model, and should not be used for real climate-policy decision-making.\n",
    "- GDP-derived features (`ghg_intensity`) have some missing values in the most recent years due to\n",
    "  reporting lag in the underlying GDP series.\n",
    "\n",
    "**Notebook standards applied throughout:** every code cell is preceded by a markdown cell explaining\n",
    "its purpose, all charts include titles/axis labels/legends, variable names are descriptive, and the\n",
    "notebook runs cleanly from top to bottom."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
