{ "cells": [ { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "from entsoe import EntsoePandasClient\n", "from entsoe.exceptions import NoMatchingDataError\n", "import pandas as pd\n", "from pathlib import Path\n", "import os\n", "\n", "Path.cwd()\n", "os.listdir()\n", "\n", "api_key = \"b45ffb86-fea3-49e7-9c01-9ad6429d3ec9\"\n", "client = EntsoePandasClient(api_key=api_key)\n", "\n", "start = pd.Timestamp('20190101', tz='Europe/Brussels')\n", "end = pd.Timestamp('20200101', tz='Europe/Brussels')\n", "\n", "countries = ['AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'ME', 'MK', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'SE', 'SI', 'SK']\n", "\n", "for country in countries:\n", " print(f\"Trying country {country}.\")\n", "\n", " country_code = country\n", " # generation_country = client.query_generation(country_code, start=start,end=end, psr_type=None)\n", " try:\n", " gen = client.query_generation(country, start=start, end=end, psr_type=None)\n", " except NoMatchingDataError:\n", " continue\n", " \n", " gen.to_csv(Path.cwd() / \"generation_data\" / f\"{country}.csv\")\n", "\n", " #generation.append(generation_country)\n", " #day_ahead_prices_country = client.query_day_ahead_prices(country_code, start, end)\n", "\n", "#generation = pd.concat(generation, keys=countries, axis=1)\n", "\n", "#client.query_crossborder_flows(country_code_from, country_code_to, start, end)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "gen = generation_country" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | 2019-01-01 00:00:00+01:00 | \n", "2019-01-01 00:15:00+01:00 | \n", "2019-01-01 00:30:00+01:00 | \n", "2019-01-01 00:45:00+01:00 | \n", "2019-01-01 01:00:00+01:00 | \n", "2019-01-01 01:15:00+01:00 | \n", "2019-01-01 01:30:00+01:00 | \n", "2019-01-01 01:45:00+01:00 | \n", "2019-01-01 02:00:00+01:00 | \n", "2019-01-01 02:15:00+01:00 | \n", "... | \n", "2019-01-01 21:30:00+01:00 | \n", "2019-01-01 21:45:00+01:00 | \n", "2019-01-01 22:00:00+01:00 | \n", "2019-01-01 22:15:00+01:00 | \n", "2019-01-01 22:30:00+01:00 | \n", "2019-01-01 22:45:00+01:00 | \n", "2019-01-01 23:00:00+01:00 | \n", "2019-01-01 23:15:00+01:00 | \n", "2019-01-01 23:30:00+01:00 | \n", "2019-01-01 23:45:00+01:00 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Fossil Gas | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "... | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "
Hydro Pumped Storage | \n", "1827.0 | \n", "1335.0 | \n", "1120.0 | \n", "1218.0 | \n", "999.0 | \n", "1104.0 | \n", "1853.0 | \n", "2178.0 | \n", "2112.0 | \n", "2372.0 | \n", "... | \n", "1936.0 | \n", "2519.0 | \n", "1818.0 | \n", "1832.0 | \n", "1799.0 | \n", "2129.0 | \n", "2438.0 | \n", "3601.0 | \n", "3590.0 | \n", "4294.0 | \n", "
2 rows × 96 columns
\n", "