Challenge 3: Electricity Production and Use Analysis¶
Objectives
You have access to the Statistics Sweden (SCB) data through the MCP server. You can query energy data using the scb_* tools. The goal is to analyze and compare electricity production and use in Sweden.
Use case¶
Challenge
Retrieve and analyze the electricity supply and use data for Sweden for the years 2010-2024. Focus on the following aspects:
Total production by energy source (Hydro power, Wind power, Solar, Nuclear power, etc.)
Production and use (including exports).
Total use by sector (Manufacturing industries, Services, Agriculture, Households, Exports)
Calculate the percentage contribution of each energy source to the total production and visualize the trends.
Important
Example workflow
Start by searching for tables showing electricity supply and use data.
Ground truth: SCB report: Electricity supply and use 2001–2024 (GWh)
The required tables can be easily retrieved using the search function in the MCP server. However, just in case you get stuck, here is a hint:
Hint
The following tables to use:
Electricity supply use data: Retrieve from table TAB1010
Electricity use data: Retrieve from table TAB991
Further improvements¶
Optional Challenges
Interactive Visualization: Create an interactive plot showing the trends of electricity production and use over time.
Tip
Instruct which library to use:
Generate a Python app which uses libraries like Plotly, Matplotlib, Gradio, Streamlit, Holoviz, Altair, Seaborn, or Bokeh
Use Javascript (either front-end only or full-stack) app which uses D3.js, Chart.js, Vega-Lite, Observable Plot, or Pico.css
For data handling, SCB returns JSON-stat responses which can be processed using:
Python: pyjstat
JavaScript: jsonstat-toolkit
Renewable Energy Analysis: Analyze the contribution of renewable energy sources (Hydro power, Wind power, Solar) to the total production.
Price correlation: Compare against data for Electricity grid prices and electricity prices for households and non-households. What is driving this trend? Productions vs use or exports?
Tip
Use multiple charts to make a mini investigation. You can choose to compile it into a report or a slidedeck. You can use tools like Pandoc to generate a PDF or Reveal.js to make a presentation.