{ "cells": [ { "cell_type": "markdown", "id": "6d52755e-c428-44bd-ba3a-1213b0d9b5f1", "metadata": { "tags": [] }, "source": [ "# Download data from ECB's SDW\n", "\n", "For more info on the ECB's web API, see [here](https://sdw-wsrest.ecb.europa.eu/help/)" ] }, { "cell_type": "code", "execution_count": 1, "id": "786a5b18-0290-4138-9d06-8ebc7f719ccd", "metadata": {}, "outputs": [], "source": [ "import io\n", "import pandas as pd\n", "import requests\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "id": "cb985c7d-d2df-4797-8e6b-d10aff1133dc", "metadata": {}, "source": [ "First, lets import the _HICP Code List Description_ table from the ECB's SDW site [here](https://sdw.ecb.europa.eu/datastructure.do?conceptMnemonic=ICP_ITEM&datasetinstanceid=122#cl) into a pandas dataframe." ] }, { "cell_type": "code", "execution_count": 2, "id": "3dc728a6-03ca-4fb0-8c84-d74af2f318c2", "metadata": {}, "outputs": [], "source": [ "url = 'https://sdw.ecb.europa.eu/datastructure.do?conceptMnemonic=ICP_ITEM&datasetinstanceid=122#cl'" ] }, { "cell_type": "code", "execution_count": 4, "id": "5ca08bbd-15e2-4205-a905-0ca2b3342243", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Code Description | \n", "
---|---|
Code | \n", "\n", " |
000000 | \n", "HICP - Overall index | \n", "
010000 | \n", "HICP - FOOD AND NON-ALCOHOLIC BEVERAGES | \n", "
011000 | \n", "HICP - Food | \n", "
011100 | \n", "HICP - Bread and cereals | \n", "
011110 | \n", "HICP - Rice | \n", "
... | \n", "... | \n", "
XESEAS | \n", "HICP - All-items excluding energy and seasonal... | \n", "
XFROOP | \n", "HICP - All-items excluding frequent out-of-poc... | \n", "
XFUELL | \n", "HICP - All-items excl. liquid fuels and fuels ... | \n", "
XRENT0 | \n", "HICP - All-items excluding actual rentals for ... | \n", "
XSEAS0 | \n", "HICP - All-items excluding seasonal food | \n", "
3676 rows × 1 columns
\n", "\n", " | TIME_PERIOD | \n", "OBS_VALUE | \n", "
---|---|---|
0 | \n", "1997-01 | \n", "2.0 | \n", "
1 | \n", "1997-02 | \n", "1.8 | \n", "
2 | \n", "1997-03 | \n", "1.6 | \n", "
3 | \n", "1997-04 | \n", "1.3 | \n", "
4 | \n", "1997-05 | \n", "1.4 | \n", "