How a country powers itself reveals its policy and economic priorities

Michael Caballero
Posted on May 7, 2018

Energy is a core sector

Businesses from agriculture to tech rely on energy. Governments often generate or own power plants as well as craft energy policy. Expanding the energy sector while reducing greenhouse gas emissions for a power-hungry planet has been a topic of discussion for the past several decades.

Understanding how a country generates its power in a case study can lead to trade insights for a given region. Emerging trends also highlight policy priorities.

To that end, I built an interactive web app that could be used by economists and policymakers alike to support their own efforts to explore global electricity trends.

The UN Energy Statistics Database

The United Nations Statistics Division has collected energy-related information and shared it through the Energy Statistics Database in the UNdata portal. I came across this dataset on Kaggle, where I downloaded energy statistics data for this app.

I focused on electric capacity from this rich dataset because a power plant represents a significant capital expenditure (as either a public or private sector investment) and profit margins are tight. In other words, power plants have to operate efficiently over many years to be profitable - implying consistent use. Building a certain type of power plant also represents a significant, long-term commitment to that energy strategy.

The Electricity Explorer app

Scatterplot of changes in electric capacity by country

Selecting countries in the Electric Explorer app

A country's absolute vs relative net changes in electricity power plant capacity is visualized on the first tab. Users can search for trends and countries they are curious about by brushing over points on the graph that identify countries below. Countries with high absolute capacity changes, like the USA, China and India, are on the far right of this graph. Countries that have significantly increased their relative capacity are on the top of this graph, like the Maldives.

Alternative energy development

Changes in alternative energy capacity over time is visualized on the second tab. I calculated an index that reflects the amount of alternative electricity capacity normalized by total electricity capacity. Clicking the play button animates this graph, showing changes in this distribution by year.

Many countries have relied heavily on energy production from combustible fuels, so these distributions are skewed. Over time, distributions shift for most regions - possibly due to international efforts to expand alternative energy initiatives. The Oceania region appears to exhibit the most dramatic investment in alternative energy electricity capacity.

Breaking down capacity by country

Germany electric power capacity by type, 1999 - 2014

Germany has invested in wind, and more recently, solar power capacity

Previous tabs enable the user to quickly explore countries and regions for changes in electricity capacity - leading to questions about particular countries. On the third tab, the user can select or type in a country of interest. This generates a graph which breaks down electric capacity in detail: fossil fuels, solar, wind, nuclear, and so on.

Some interesting trends to check out include:

  • Japan increasing solar investment as nuclear power lagged after the Fukushima disaster in 2011
  • Italy replacing some of its combustible electric plant capacity with solar
  • Norway relying on hydrothermal for decades, but increasing combustible power plant capacity up to 2010


I built an app designed to help users interested in electricity to quickly learn about a country they are interested in. This app helps initiate more questions about energy policy and trade. These questions can be answered through targeted, follow-up investigation of the larger UN Energy Statistics Database. Check the app out here, and thanks for reading.

About Author

Michael Caballero

Michael Caballero

Michael Caballero is a Data Science Fellow at NYCDSA who loves tackling interdisciplinary challenges. He has deployed multiple interactive web apps incorporating data analysis, visualization, and recommender systems. Michael attributes his award winning communication skills to his time...
View all posts by Michael Caballero >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp