High-Level Trends in Renewable and Fossil Fuel Energy: Part 2

Rafael Villanueva
5 min readMay 23, 2021

In the last blog which was the first part of my five-part series on energy, we reviewed some industry background and how the future for fossil fuels and renewables appear to be headed in different directions. As a primer, I suggest taking a look at Wood Mackenzie’s “Reversal of fortune: oil and gas prices in a 2-degree world” that discuss different scenarios for oil and gas prices and growth in renewables over the coming decades. However, in this blog, we will focus on trends in renewables over the last twenty years (2000–2020) using the data set consisting of energy use by the five most populous countries we pulled from the EIA API in the last blog. I decided to use Plotly for its interactive, publication-quality graphs. Let’s get started!

First, we will import our libraries, for graphing purposes we will use Plotly Express and Plotly Graph Objects. Plotly Express is the recommended library for efficient code but Graph Objects allows for the user to build the Plotly graph with more customization, although it is less efficient (https://plotly.com/python/graph-objects/)

# importing libraries same as first blog except we will focus on Plotly express and graph_objectsimport pandas as pd
import requests
import matplotlib.pyplot as plt
import numpy as np
from datetime import date
import plotly.express as px
import matplotlib.ticker as ticker
from plotly import graph_objects as go
from fbprophet import Prophet
from fbprophet.plot import add_changepoints_to_plot
from sklearn.metrics import mean_squared_error, mean_absolute_error
from IPython.core.display import display, HTML
from IPython.display import IFrame
import warnings
warnings.filterwarnings("ignore")

At this point, we have our data and we have our libraries and we have our data loaded into a dataframe that looks something like this:

We are going to work with line plots to see the changes in energy use over the last twenty years. My preference is to set the ‘Date’ column to the index and then transpose the data into a wide format like this:

For the first set of graphs, Plotly Express will be our go-to for its simplicity. Now let’s create some line graphs! I will show the code snippet for the first one which is the same syntax for the rest. This process could likely be functionalized in the future.

Figure 1: Our first graph shows energy consumption by country since 2000 in BKWh. Immediately we see that the U.S. and China are the two largest consumers of energy but are trending in different directions.
Figure 2: Our second graph shows the population by country for the top five most populous countries. India and China are way out in front in terms of population but in terms of growth, they seem to be leveling out.
Figure 3: China outstrips the rest of the country’s on our list in terms of growth in renewable generation. But as we’ll see in the next graph still a small proportion of the total energy mix.
Figure 4: We see here that the U.S. is leveling off or even decreasing electricity generation compared to China’s rapid growth, India shows notable growth but still far behind U.S. and China.

The above graphs show that energy consumption is not shared evenly over the most populous countries. From the countries included in this study, as of 2020 China and India have populations far greater than the others(1.47 and 1.37 billion). However, according to Figure 1, China and the U.S. are the largest consumers of energy even though the U.S. has only about 20% of China’s population(Figure 2). Figures 3 and 4 provide information about the growth (or lack thereof) of energy generation by source (fossil fuel or renewable). In terms of growth, China is on a much different trajectory in terms of total electricity generation in both renewables and fossil fuels while the U.S. has begun to decline in the generation of electricity from fossil fuels. Outside of the U.S and China, India is trending upwards in energy consumption as well as generation from both sources(Figures 1,3, and 4). One final observation is in Figures 3 and 4 we see that over the last twenty years Brazil has generated more electricity from renewables than from fossil fuels.

So what does this mean? From this data, we can see that at least over the last twenty years the top five most populous countries are in very different places in terms of energy generation and consumption. China is still growing rapidly in both forms of energy generation and according to S&P plans to reach peak coal by 2030 and net-zero by 2060. In the U.S., President Joe Biden has announced a 2050 net-zero target. India is also growing and according to the National Resources Defense Council, has not pledged a date to reach net-zero but is under international pressure to do so by the end of the year at the United Nations Climate Change Conference. Brazil is an interesting case as it has the greatest proportion of total energy coming from renewables but is the world’s fifth-largest emitter with a 2060 net-zero target. However, unlike the other countries on this list, the largest proportion of its emissions are due to deforestation, particularly in the Amazon Rainforest.

In the second part of the series, we looked at high-level trends of population, electricity consumption, and electricity generation. We saw that from visualizing the last twenty years of energy-related data that the only simple deduction one can make is that energy consumption and generation from fossil fuels remain high and in some cases increasing. Net-zero remains an elusive goal for many countries since cheap, easy to access fuel and energy are key to growing economies like China and India. However, it is important to underline that many of the countries have set goals for reaching net-zero in the coming decades. But how will this energy be generated? renewable energy is not a new concept and technologies are advancing every day. In the next part of this series, we’ll cover trends in renewable energy.

--

--