Plotting the World Oil Reserves

Oil Dataviz Web Scraping

Have you ever seen this plot?

In [1]:
from IPython.display import Image
Image(url='http://planetforlife.com/images/growinggap.jpg')
Out[1]:

What this plot shows are historical discoveries of regular conventional oil (aka "oil fields") and production (aka "taking oil out of the oil field"). People who try to understand the world often think about this problem when they consider how much our current way of life is based on oil.

Ever since I first saw a version of this plot in a talk (this one), I've been wondering about this fascinating data. Since there is an oil field list page on Wikipedia, let's try to see if we can roughly replicate this curve.

Oil fields on Wikipedia

The data for oil fields can be found here: https://en.wikipedia.org/wiki/List_of_oil_fields. Let's download the data and parse it into a table. We can do this with a little bit of manual fiddling using requests, beautifulsoup and pandas.

In [2]:
import requests
from bs4 import BeautifulSoup
import pandas as pd
In [3]:
r = requests.get('https://en.wikipedia.org/wiki/List_of_oil_fields')
tree = BeautifulSoup(r.text, 'html.parser')
table = tree.find('table', class_='wikitable')
df = pd.read_html(str(table), header=0)[0]
In [4]:
df.head()
Out[4]:
Field Location Discovered Started production Peaked Recoverable oil, past and future (billion barrels) Production (million barrels/day) Rate of decline
0 Ghawar Field Saudi Arabia 1948[3] 1951[3] 2005,[4] disputed[5] 88-104[6] 5[7] 8% per year[8]
1 Burgan Field Kuwait 1937 1948 2005[9] 66-72[8] 1.7[10] 14% per year[citation needed]
2 Ahvaz Field Iran 1958 NaN 1970s[11] 65 (25 recoverable)[12] .750[13] NaN
3 Upper Zakum oil field Abu Dhabi, UAE 1963[14] 1982[15][16] (1967[14]) Production still increasing 50[15] (21 recoverable[14]) 0.750[15] Extension planned to 1 MMb/d[17]
4 Gachsaran Field Iran 1927 1930 1974 66[18] 0.480 NaN

Analysis

Now that we have this list of oil fields, we can do some elementary plot by country and year discovered.

By country

In [5]:
import holoviews as hv
hv.extension('bokeh')