{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Working with the OECD - ICIO database" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The OECD Inter-Country Input-Output tables (ICIO) are available on the [OECD webpage.](https://www.oecd.org/sti/ind/inter-country-input-output-tables.htm) \n", "\n", "The parsing function >parse_oecd< works for both, the 2016 and 2018 release." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The tables can either be downloaded manually (using the csv format), or the pymrio [OECD automatic downloader can be used](autodownload.ipynb#OECD-download)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example, to get the 2011 table of the 2018 release do:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pymrio" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from pathlib import Path" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "oecd_storage = Path(\"/tmp/mrios/OECD\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "meta_2018_download = pymrio.download_oecd(storage_folder=oecd_storage, years=[2011])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "OECD provides the data compressed in zip files. The pymrio oecd parser works with both, the compressed and unpacked version." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parsing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To parse a single year of the database, either specify a path and year:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "oecd_path_year = pymrio.parse_oecd(path=oecd_storage, year=2011)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or directly specify a file to parse:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "oecd_file = pymrio.parse_oecd(path=oecd_storage / \"ICIO2018_2011.zip\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "oecd_path_year == oecd_file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note: The original OECD ICIO tables provide some disaggregation of the Mexican and Chinese tables for the interindustry flows. The pymrio parser automatically aggregates these into Chinese And Mexican totals. Thus, the MX1, MX2, .. and CN1, CN2, ... entries are aggregated into MEX and CHN." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Currently, the parser only includes the value added and taxes data given in original file as satellite accounts.\n", "These are accessable in the extension \"factor_inputs\":" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
regionARG...ZAF
sector01T0305T0607T080910T1213T151617T181920T21...6162T6364T666869T82848586T8890T9697T98
inputtype
AUS_TAXSUB0.1217140.0177120.0175120.0178160.0016610.0959730.0077180.0346780.1285020.162166...0.4021710.6740910.1003440.6265091.3737281.6105700.2465730.6346040.3335800.0
AUT_TAXSUB0.0737750.0330710.0138160.0052580.0788890.0381980.0106750.0259810.0153190.083526...0.0792670.0422840.0226760.0615000.1651650.4204490.0420980.4492500.0723400.0
BEL_TAXSUB0.1859010.0620700.0244580.0112600.1486900.0940590.0121820.0571370.0614760.196174...0.1175140.0927870.0788510.1457960.3946430.5352110.0885720.3577820.0928430.0
CAN_TAXSUB1.1905190.2890640.2305540.0564900.4558200.1501270.0355870.0763430.8718240.537732...0.1116600.0645950.0221360.0653460.1741130.2723040.0372560.1025100.0867030.0
CHL_TAXSUB0.8005140.2539730.1769480.0445631.0249211.2320060.1026070.3217500.3819830.583021...0.0061960.0063980.0037760.0190490.0294770.0298430.0130840.0223140.0099110.0
\n", "

5 rows × 2340 columns

\n", "
" ], "text/plain": [ "region ARG \\\n", "sector 01T03 05T06 07T08 09 10T12 13T15 \n", "inputtype \n", "AUS_TAXSUB 0.121714 0.017712 0.017512 0.017816 0.001661 0.095973 \n", "AUT_TAXSUB 0.073775 0.033071 0.013816 0.005258 0.078889 0.038198 \n", "BEL_TAXSUB 0.185901 0.062070 0.024458 0.011260 0.148690 0.094059 \n", "CAN_TAXSUB 1.190519 0.289064 0.230554 0.056490 0.455820 0.150127 \n", "CHL_TAXSUB 0.800514 0.253973 0.176948 0.044563 1.024921 1.232006 \n", "\n", "region ... ZAF \\\n", "sector 16 17T18 19 20T21 ... 61 62T63 \n", "inputtype ... \n", "AUS_TAXSUB 0.007718 0.034678 0.128502 0.162166 ... 0.402171 0.674091 \n", "AUT_TAXSUB 0.010675 0.025981 0.015319 0.083526 ... 0.079267 0.042284 \n", "BEL_TAXSUB 0.012182 0.057137 0.061476 0.196174 ... 0.117514 0.092787 \n", "CAN_TAXSUB 0.035587 0.076343 0.871824 0.537732 ... 0.111660 0.064595 \n", "CHL_TAXSUB 0.102607 0.321750 0.381983 0.583021 ... 0.006196 0.006398 \n", "\n", "region \\\n", "sector 64T66 68 69T82 84 85 86T88 \n", "inputtype \n", "AUS_TAXSUB 0.100344 0.626509 1.373728 1.610570 0.246573 0.634604 \n", "AUT_TAXSUB 0.022676 0.061500 0.165165 0.420449 0.042098 0.449250 \n", "BEL_TAXSUB 0.078851 0.145796 0.394643 0.535211 0.088572 0.357782 \n", "CAN_TAXSUB 0.022136 0.065346 0.174113 0.272304 0.037256 0.102510 \n", "CHL_TAXSUB 0.003776 0.019049 0.029477 0.029843 0.013084 0.022314 \n", "\n", "region \n", "sector 90T96 97T98 \n", "inputtype \n", "AUS_TAXSUB 0.333580 0.0 \n", "AUT_TAXSUB 0.072340 0.0 \n", "BEL_TAXSUB 0.092843 0.0 \n", "CAN_TAXSUB 0.086703 0.0 \n", "CHL_TAXSUB 0.009911 0.0 \n", "\n", "[5 rows x 2340 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "oecd_file.factor_inputs.F.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Handling of the data happens similar to the other databases, see for example [\"Exploring EXIOBASE\"](working_with_exiobase.ipynb#Exploring-EXIOBASE)." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }