{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "23323f5e-3aa0-4ef1-9b52-78e4f1c6f2dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXIOBASE (Industry by industry version): 1\n",
    "import pymrio\n",
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# File path\n",
    "exiobase_path  = r\"C:\\Users\\asbj20\\OneDrive - University of Bath\\Desktop\\IOT_2022_ixi.zip\"\n",
    "\n",
    "# Load the EXIOBASE data\n",
    "exiobase = pymrio.parse_exiobase3(path=exiobase_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "44d12354-1755-4de8-8ec9-3d215c4f045c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pymrio.core.mriosystem.IOSystem at 0x1a8387e5310>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# EXIOBASE (Industry by industry version): 2\n",
    "\n",
    "#Automatically identifies missing tables and calculates all necessary accounts (L, A, etc)\n",
    "exiobase.calc_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2801a36f-9bd9-41e6-9ff8-75500e004e00",
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXIOBASE (Industry by industry version): 3\n",
    "\n",
    "# Extract the Multiplier Matrix for air emissions.\n",
    "M = exiobase.air_emissions.M\n",
    "\n",
    "# save the CSV file\n",
    "save_path = r'C:\\Users\\asbj20\\OneDrive - University of Bath\\Desktop\\M_IOT_2022_ixi.csv'\n",
    "M.to_csv(save_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e9922a30-f6ff-4663-93df-d74483063a1f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXIOBASE (Product by product version): 1\n",
    "import pymrio\n",
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# File path\n",
    "exiobase_path  = r\"C:\\Users\\asbj20\\OneDrive - University of Bath\\Desktop\\IOT_2022_pxp.zip\"\n",
    "\n",
    "# Load the EXIOBASE data\n",
    "exiobase = pymrio.parse_exiobase3(path=exiobase_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "98e3faf6-f484-4a01-a272-3c19b01f4831",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pymrio.core.mriosystem.IOSystem at 0x1a845166dd0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# EXIOBASE (Product by product version): 2\n",
    "\n",
    "#Automatically identifies missing tables and calculates all necessary accounts (L, A, etc)\n",
    "exiobase.calc_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "aa9b113b-8a10-49bb-bec5-e4a86d3be6a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXIOBASE (Product by product version): 3\n",
    "\n",
    "# Extract the Multiplier Matrix for air emissions.\n",
    "M = exiobase.air_emissions.M\n",
    "\n",
    "# save the CSV file\n",
    "save_path = r'C:\\Users\\asbj20\\OneDrive - University of Bath\\Desktop\\M_IOT_2022_pxp.csv'\n",
    "M.to_csv(save_path)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "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.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
