{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Why worry?\n", "\n", "From PWC's [Low Carbon Economy Index 2018](https://www.pwc.co.uk/services/sustainability-climate-change/insights/low-carbon-economy-index.html):\n", "> Carbon intensity continued to fall at a rate consistent with the previous few years, at 2.6%. But even this falls short of the 3% average decarbonisation rate needed to meet the weak national targets pledged in the 2015 Paris Agreement. The gap between the current decarbonisation rate and that needed to limit global warming to two degrees is widening. It’s now 6.4% per year for the rest of this century.\n", "\n", "> In contrast with our report last year, not one of the G20 countries achieved the 6.4% rate required to limit warming to two degrees this year. That goal is slipping further out of reach – at current levels of decarbonisation, the global carbon budget for two degrees will run out in 2036.\n", "\n", "Not sure we are on the right track! But maybe you want to check by yourself.\n", "\n", "In this notebook, we access publicly available data from the [World Bank](https://www.worldbank.org), and vizualise the evolution of greenhouse gas emissions, as well as that of the much related gross domestic product." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# World Bank data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The [World Bank](https://www.worldbank.org/) offers a wide set of economic and developement indicators. We download the values for a few of these indicators using `wbdata`, reshape the data using `pandas`, and explore the metrics using `ploty` and `ipywidgets`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "lines_to_end_of_cell_marker": 2 }, "outputs": [], "source": [ "import os\n", "import pandas as pd\n", "import wbdata as wb\n", "\n", "# My preferences for printing DataFrames: few rows, and many columns.\n", "pd.options.display.max_rows = 6\n", "pd.options.display.max_columns = 20\n", "\n", "\n", "# Download just once the desired indicators, save to a file\n", "def download_once(indicators, path):\n", " if os.path.isfile(path):\n", " return pd.read_hdf(path, 'indicators')\n", "\n", " data = wb.get_dataframe(indicators, convert_date=True).sort_index()\n", " data.to_hdf(path, 'indicators')\n", "\n", " return data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The names of the indicators below were found using the World Bank indicator [search page](https://data.worldbank.org/indicator). There are actually many more indicators there!" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "indicators = {\n", " 'SP.POP.TOTL': 'Population, total',\n", " 'AG.SRF.TOTL.K2': 'Surface area (sq. km)',\n", " 'AG.LND.TOTL.K2': 'Land area (sq. km)',\n", " 'AG.LND.ARBL.ZS': 'Arable land (% of land area)',\n", " 'EN.ATM.GHGT.KT.CE': 'Total greenhouse gas emissions (kt of CO2 equivalent)',\n", " 'EN.ATM.CO2E.KT': 'CO2 emissions (kt)',\n", " 'EN.ATM.NOXE.KT.CE': 'Nitrous oxide emissions (thousand metric tons of CO2 equivalent)',\n", " 'EN.ATM.METH.KT.CE': 'Methane emissions (kt of CO2 equivalent)',\n", " 'EN.ATM.CO2E.SF.KT': 'CO2 emissions from solid fuel consumption (kt)',\n", " 'EN.ATM.CO2E.LF.KT': 'CO2 emissions from liquid fuel consumption (kt)',\n", " 'EN.ATM.CO2E.GF.KT': 'CO2 emissions from gaseous fuel consumption (kt)',\n", " 'EN.CO2.MANF.ZS': 'CO2 emissions from manufacturing industries and construction (% of total fuel combustion)',\n", " 'EN.CO2.TRAN.ZS': 'CO2 emissions from transport (% of total fuel combustion)',\n", " 'EN.ATM.CO2E.GF.ZS': 'CO2 emissions from gaseous fuel consumption (% of total)',\n", " 'EN.ATM.CO2E.KD.GD': 'CO2 emissions (kg per 2010 US$ of GDP)',\n", " 'AG.YLD.CREL.KG': 'Cereal yield (kg per hectare)',\n", " 'AG.PRD.LVSK.XD': 'Livestock production index (2004-2006 = 100)',\n", " 'AG.PRD.CROP.XD': 'Crop production index (2004-2006 = 100)',\n", " 'NY.GDP.MKTP.CD': 'GDP (current US$)',\n", " 'NY.GDP.MKTP.KD': 'GDP (constant 2010 US$)'}" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "world_bank_data = download_once(indicators, 'world_bank_indicators.hdf')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "lines_to_next_cell": 2 }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Population, totalSurface area (sq. km)Land area (sq. km)Arable land (% of land area)Total greenhouse gas emissions (kt of CO2 equivalent)CO2 emissions (kt)Nitrous oxide emissions (thousand metric tons of CO2 equivalent)Methane emissions (kt of CO2 equivalent)CO2 emissions from solid fuel consumption (kt)CO2 emissions from liquid fuel consumption (kt)CO2 emissions from gaseous fuel consumption (kt)CO2 emissions from manufacturing industries and construction (% of total fuel combustion)CO2 emissions from transport (% of total fuel combustion)CO2 emissions from gaseous fuel consumption (% of total)CO2 emissions (kg per 2010 US$ of GDP)Cereal yield (kg per hectare)Livestock production index (2004-2006 = 100)Crop production index (2004-2006 = 100)GDP (current US$)GDP (constant 2010 US$)
date
1960-01-013.032160e+09NaNNaNNaNNaN9396705.835NaNNaN5148390.9933112685.279832409.029.30383119.1726908.8585190.838262NaNNaNNaN1.365887e+121.120951e+13
1961-01-013.073369e+09134043190.4129721455.49.693086NaN9434402.595NaNNaN4922313.1093314109.922880080.028.66793519.4139479.3284130.8066091421.61938933.02720132.4831941.420995e+121.169612e+13
1962-01-013.126510e+09134043190.4129721435.49.726105NaN9818839.874NaNNaN4925760.0893592479.226964421.027.80438219.3407379.8221480.7951961510.86325933.86823633.7710171.526067e+121.234743e+13
...............................................................
2015-01-017.357559e+09134325130.2129732901.810.991288NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN3923.219588NaNNaN7.484273e+137.573359e+13
2016-01-017.444157e+09134325130.2129733172.7NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN3966.779315NaNNaN7.593681e+137.763127e+13
2017-01-017.530360e+09134325130.2129733172.7NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN8.068379e+138.007783e+13
\n", "

58 rows × 20 columns

\n", "
" ], "text/plain": [ " Population, total Surface area (sq. km) Land area (sq. km) \\\n", "date \n", "1960-01-01 3.032160e+09 NaN NaN \n", "1961-01-01 3.073369e+09 134043190.4 129721455.4 \n", "1962-01-01 3.126510e+09 134043190.4 129721435.4 \n", "... ... ... ... \n", "2015-01-01 7.357559e+09 134325130.2 129732901.8 \n", "2016-01-01 7.444157e+09 134325130.2 129733172.7 \n", "2017-01-01 7.530360e+09 134325130.2 129733172.7 \n", "\n", " Arable land (% of land area) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 9.693086 \n", "1962-01-01 9.726105 \n", "... ... \n", "2015-01-01 10.991288 \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " Total greenhouse gas emissions (kt of CO2 equivalent) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 NaN \n", "1962-01-01 NaN \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions (kt) \\\n", "date \n", "1960-01-01 9396705.835 \n", "1961-01-01 9434402.595 \n", "1962-01-01 9818839.874 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " Nitrous oxide emissions (thousand metric tons of CO2 equivalent) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 NaN \n", "1962-01-01 NaN \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " Methane emissions (kt of CO2 equivalent) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 NaN \n", "1962-01-01 NaN \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from solid fuel consumption (kt) \\\n", "date \n", "1960-01-01 5148390.993 \n", "1961-01-01 4922313.109 \n", "1962-01-01 4925760.089 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from liquid fuel consumption (kt) \\\n", "date \n", "1960-01-01 3112685.279 \n", "1961-01-01 3314109.922 \n", "1962-01-01 3592479.226 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from gaseous fuel consumption (kt) \\\n", "date \n", "1960-01-01 832409.0 \n", "1961-01-01 880080.0 \n", "1962-01-01 964421.0 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from manufacturing industries and construction (% of total fuel combustion) \\\n", "date \n", "1960-01-01 29.303831 \n", "1961-01-01 28.667935 \n", "1962-01-01 27.804382 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from transport (% of total fuel combustion) \\\n", "date \n", "1960-01-01 19.172690 \n", "1961-01-01 19.413947 \n", "1962-01-01 19.340737 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions from gaseous fuel consumption (% of total) \\\n", "date \n", "1960-01-01 8.858519 \n", "1961-01-01 9.328413 \n", "1962-01-01 9.822148 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " CO2 emissions (kg per 2010 US$ of GDP) \\\n", "date \n", "1960-01-01 0.838262 \n", "1961-01-01 0.806609 \n", "1962-01-01 0.795196 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " Cereal yield (kg per hectare) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 1421.619389 \n", "1962-01-01 1510.863259 \n", "... ... \n", "2015-01-01 3923.219588 \n", "2016-01-01 3966.779315 \n", "2017-01-01 NaN \n", "\n", " Livestock production index (2004-2006 = 100) \\\n", "date \n", "1960-01-01 NaN \n", "1961-01-01 33.027201 \n", "1962-01-01 33.868236 \n", "... ... \n", "2015-01-01 NaN \n", "2016-01-01 NaN \n", "2017-01-01 NaN \n", "\n", " Crop production index (2004-2006 = 100) GDP (current US$) \\\n", "date \n", "1960-01-01 NaN 1.365887e+12 \n", "1961-01-01 32.483194 1.420995e+12 \n", "1962-01-01 33.771017 1.526067e+12 \n", "... ... ... \n", "2015-01-01 NaN 7.484273e+13 \n", "2016-01-01 NaN 7.593681e+13 \n", "2017-01-01 NaN 8.068379e+13 \n", "\n", " GDP (constant 2010 US$) \n", "date \n", "1960-01-01 1.120951e+13 \n", "1961-01-01 1.169612e+13 \n", "1962-01-01 1.234743e+13 \n", "... ... \n", "2015-01-01 7.573359e+13 \n", "2016-01-01 7.763127e+13 \n", "2017-01-01 8.007783e+13 \n", "\n", "[58 rows x 20 columns]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "world_bank_data.loc['World']" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "lines_to_end_of_cell_marker": 2 }, "outputs": [], "source": [ "def world(metric):\n", " \"\"\"Value of desired metric, on the World, indexed by date\"\"\"\n", " value = world_bank_data.loc['World'][metric].dropna()\n", " return value\n", "\n", "\n", "zones = ['North America', 'Middle East & North Africa',\n", " 'Latin America & Caribbean', 'Europe & Central Asia',\n", " 'Sub-Saharan Africa', 'South Asia',\n", " 'East Asia & Pacific'][::-1]\n", "\n", "\n", "def regions(metric):\n", " \"\"\"Value of desired metric, per world region (column), indexed by date\"\"\"\n", " # World regions, in order of increasing population\n", " value = world_bank_data.loc[zones][metric].dropna().swaplevel().unstack()[zones]\n", " return value" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/vnd.plotly.v1+html": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objs as go\n", "import plotly.offline as offline\n", "\n", "offline.init_notebook_mode()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Metric explorer" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "lines_to_next_cell": 2 }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8f19c82f5eaf4eee87e451e5a250776a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Metric', index=5, options=('Population, total', 'Surface area (sq. km)', 'Land area (sq.…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3424eaabccba4e5fab4a0d6a48f6ad64", "version_major": 2, "version_minor": 0 }, "text/plain": [ "FigureWidget({\n", " 'data': [{'name': 'East Asia & Pacific',\n", " 'stackgroup': 'CO2 emissions (kt)',\n", "…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from ipywidgets import widgets\n", "from IPython.display import display\n", "\n", "metric_selector = widgets.Dropdown(\n", " options=list(world_bank_data),\n", " value='CO2 emissions (kt)',\n", " description='Metric')\n", "\n", "metric_explorer = go.FigureWidget()\n", "\n", "\n", "def update_plot(change):\n", " m = metric_selector.value\n", " if m in world_bank_data:\n", " metric_explorer.data = []\n", " metric_explorer.layout.title = m\n", "\n", " value_world = world(m)\n", "\n", " value_region = regions(m)\n", " for region in zones:\n", " metric_explorer.add_scatter(x=value_region.index, y=value_region[region], name=region,\n", " stackgroup=m if '%' not in m\n", " and ' 100' not in m\n", " and ' per ' not in m else None)\n", "\n", " metric_explorer.add_scatter(x=value_world.index, y=value_world, name='World', line=dict(dash='dash'))\n", "\n", "\n", "metric_selector.observe(update_plot, names=\"value\")\n", "\n", "display(metric_selector)\n", "update_plot(None)\n", "display(metric_explorer)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# A few plots" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Greenhouse gas emissions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Greenhouse gas emissions have increased steadily over the last decades. CO2 emissions are two thirds of the total emissions, and were multiplied by 3.5 since the sixties." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "line": { "dash": "dash" }, "name": "Total", "type": "scatter", "uid": "8553307f-e284-4556-bd95-31454dc55bb9", "x": [ "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01" ], "y": [ 27660218.4692441, 26263241.2998723, 28148780.8450884, 29107899.0532076, 28434027.1423728, 28860202.7669361, 30301513.6928308, 31553904.6660721, 32120464.1076999, 33615147.8631881, 33480327.2105969, 32418038.8664288, 34370124.10544, 33852269.0870268, 32822992.3310764, 33080640.7860281, 34049392.4487865, 35963102.0162105, 35478325.5939832, 36108991.6521977, 38232170.0568654, 38587503.8465997, 39824354.9893944, 38081369.6346788, 38810306.956182, 39040328.2291573, 39258545.3402859, 43375207.9679581, 44048270.6463198, 40891983.4934895, 40563436.9953996, 40365672.9471742, 43070574.6368545, 44422304.8693056, 45658897.9939444, 47216058.6710858, 48639987.9650553, 49977387.1136913, 48664440.8430606, 48150621.2283986, 50911113.6767191, 52790526.9956322, 53526302.8283888 ] }, { "name": "CO2", "stackgroup": "ghg", "type": "scatter", "uid": "0072e443-9a3a-4bbc-8bda-eb062088c55c", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 9396705.835, 9434402.595, 9818839.874, 10355747.346, 10947007.092, 11433441.976, 12009447.002, 12389685.566, 13017193.607, 13797116.836, 14788798.314, 15323175.556, 15957192.522, 16822109.477, 16850822.087, 16745791.873, 17726098.317, 18279804.316, 18497906.475, 19533547.949, 19324327.264, 18726246.898, 18562354, 18484356.91, 19145865.375, 19719241.162, 20315356.016, 20817151.963, 21565403.313, 22029385.156, 22149402.399, 22403928.869, 22183417.491, 22162174.56, 22551690.634, 23037524.13, 23571556.674, 23975007.348, 24114192, 24059187, 24689911, 25276631, 25646998, 27047792, 28393581, 29490014, 30568112, 31180501, 32181592, 31891899, 33472376, 34847501, 35470891, 35837591, 36138285 ] }, { "name": "Nitrous oxide", "stackgroup": "ghg", "type": "scatter", "uid": "11b65528-b58f-439f-ae50-3eea86de8bdb", "x": [ "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01" ], "y": [ 2225930.2, 2089238.8, 2245410.6, 2291020.9, 2240345.2, 2329578.7, 2412556.4, 2524965.5, 2552326.1, 2710503.6, 2732925.9, 2636112.9, 2803906.6, 2778356.4, 2693295.5, 2695397.3, 2747396.7, 2928827.3, 2791221.4, 2840340.9, 2953007.3, 2904557.4, 3076061.8, 2848968.2, 2955369.5, 2978718.7, 3011978.6, 3236772, 3120987, 2955561.7, 2920510, 2785436.8, 2850332.2, 2836658.1, 2907452.8, 2965813.4, 3100186, 3260053, 3031989.1, 3068677.6, 3084899.9, 3123551.39682461, 3153742.47904923 ] }, { "name": "Methane", "stackgroup": "ghg", "type": "scatter", "uid": "a1387681-45b5-425f-a0f9-d66946011941", "x": [ "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01" ], "y": [ 5305820, 5145430, 5360610, 5421500, 5379140, 5503270, 5649430, 5796380, 5795950, 5972760, 6011410, 5871770, 6289190, 6140330, 5987230, 6039460, 6198880, 6463470, 6290090, 6429940, 6668380, 6708550, 6846520, 6503170, 6617590, 6556730, 6551630, 7211170, 6681100, 6503140, 6480650, 6591630, 6789740, 6831780, 7088150, 7275910, 7617940, 7697440, 7643170, 7774920, 7815790, 7927060.64451536, 8014066.56168444 ] } ], "layout": { "barmode": "stack", "title": "Greenhouse gas emissions", "yaxis": { "title": "CO2 equivalent (kt)" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "data = []\n", "\n", "\n", "def add_line(full_name, legend_name, scatter_or_bar=go.Scatter, **kwargs):\n", " value = world_bank_data.loc['World'][full_name].dropna()\n", " data.append(scatter_or_bar(x=value.index.date, y=value, name=legend_name, **kwargs))\n", "\n", "\n", "add_line('Total greenhouse gas emissions (kt of CO2 equivalent)', 'Total', line=dict(dash='dash'))\n", "add_line('CO2 emissions (kt)', 'CO2', stackgroup='ghg')\n", "add_line('Nitrous oxide emissions (thousand metric tons of CO2 equivalent)', 'Nitrous oxide', stackgroup='ghg')\n", "add_line('Methane emissions (kt of CO2 equivalent)', 'Methane', stackgroup='ghg')\n", "\n", "layout = go.Layout(title='Greenhouse gas emissions', barmode='stack',\n", " yaxis=dict(title='CO2 equivalent (kt)'))\n", "\n", "offline.iplot(go.Figure(data=data, layout=layout), show_link=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Population, per world region" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "CO2 emissions increase at a larger pace than population." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "name": "East Asia & Pacific", "stackgroup": "World", "type": "scatter", "uid": "6a867298-63c9-497a-8db0-e53c16cdb737", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 1039944591, 1043546747, 1058028199, 1083802299, 1109204182, 1135650895, 1165517894, 1194424326, 1223721283, 1256501008, 1289258962, 1322942750, 1354794332, 1385052014, 1415128313, 1442241325, 1466464716, 1489361661, 1512159741, 1535391301, 1558178982, 1581806986, 1607731269, 1633628203, 1658253758, 1683448851, 1710171170, 1738276268, 1766656203, 1794408755, 1821481246, 1847530233, 1871898268, 1895356643, 1918771287, 1941918800, 1964635058, 1986799861, 2008140141, 2028095314, 2047150745, 2065521836, 2082953527, 2099545576, 2115557365, 2131363078, 2147029631, 2162104019, 2177421759, 2192352319, 2207154641, 2221934584, 2237082761, 2252311022, 2267745366, 2283108073, 2298726779, 2314364990 ] }, { "name": "South Asia", "stackgroup": "World", "type": "scatter", "uid": "edb7206b-016f-4e71-9350-cba12fdb1678", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 571835666, 583894094, 596413939, 609391805, 622822615, 636701820, 651036352, 665826653, 681054882, 696697198, 712740919, 729173562, 746012374, 763310561, 781140577, 799553306, 818560436, 838142287, 858277856, 878933031, 900076467, 921696915, 943781613, 966293643, 989188965, 1012429641, 1035982524, 1059829211, 1083963380, 1108386444, 1133089464, 1158058109, 1183253534, 1208612942, 1234059205, 1259530819, 1284978193, 1310387887, 1335777637, 1361185289, 1386625845, 1412104373, 1437568227, 1462906674, 1487975237, 1512670560, 1536943534, 1560818860, 1584359049, 1607663899, 1630806784, 1653798614, 1676615491, 1699310450, 1721847786, 1744199944, 1766393714, 1788388852 ] }, { "name": "Sub-Saharan Africa", "stackgroup": "World", "type": "scatter", "uid": "526f42d1-e379-4cab-9b3e-f5791c286616", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 228586005, 234008580, 239647139, 245503266, 251576403, 257868609, 264386171, 271139271, 278138996, 285397999, 292929074, 300737023, 308831549, 317234127, 325972033, 335064879, 344522341, 354343159, 364515830, 375034981, 385885281, 397065556, 408577033, 420413518, 432573431, 445048059, 457835414, 470938971, 484357710, 498102752, 512177101, 526599014, 541365685, 556451898, 571828603, 587469624, 603385639, 619607956, 636182577, 653179863, 670649638, 688615995, 707099850, 726140617, 745788118, 766080507, 787035792, 808660166, 830965556, 853953657, 877628367, 901989926, 927039875, 952734072, 979017918, 1005850049, 1033212743, 1061107721 ] }, { "name": "Europe & Central Asia", "stackgroup": "World", "type": "scatter", "uid": "d422a862-076d-4e24-b450-745d70388bb0", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 667246384, 674972972, 682938669, 690962675, 698905664, 706609007, 713341112, 719879789, 726161895, 732317863, 737948178, 743607439, 749815857, 755867961, 761701324, 767332578, 772838318, 778094845, 783298994, 788525199, 793937090, 799215272, 803972967, 808524728, 813281381, 818146882, 823155058, 828213790, 833315236, 838462813, 842848473, 846178276, 849656745, 852762016, 854723055, 856352860, 857652705, 859112733, 860236341, 861380108, 862304086, 863615632, 865196877, 867457664, 870030756, 872661616, 875343235, 878465990, 881965815, 885591814, 889016507, 891098854, 894679968, 898881448, 903123160, 907426233, 911686319, 915545801 ] }, { "name": "Latin America & Caribbean", "stackgroup": "World", "type": "scatter", "uid": "3a4627e3-971d-4b41-b6c2-374f971e12b2", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 220434662, 226564469, 232897323, 239401268, 246016368, 252710310, 259468669, 266295880, 273209036, 280225795, 287361389, 294620137, 301984430, 309446959, 316987646, 324590837, 332247800, 339956419, 347735305, 355593111, 363543431, 371580994, 379697683, 387868173, 396059351, 404246768, 412413602, 420560827, 428701267, 436857131, 445044474, 453251622, 461466819, 469673465, 477832467, 485913138, 493920488, 501837820, 509664957, 517324344, 524829251, 532172709, 539372044, 546478662, 553563090, 560673962, 567821716, 574994397, 582179826, 589349327, 596478519, 603537118, 610547919, 617495658, 624335544, 631062657, 637663890, 644137666 ] }, { "name": "Middle East & North Africa", "stackgroup": "World", "type": "scatter", "uid": "9497da3b-29bd-47c1-b100-51d03534ceab", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 105488678, 108374227, 111385940, 114471415, 117671617, 120973578, 124374455, 127947266, 131566224, 135279930, 139083819, 142950993, 146887303, 150999871, 155259901, 159722643, 164407528, 169318424, 174493349, 180000521, 185843847, 192015875, 198499602, 205229901, 212102793, 219095273, 226161475, 233285188, 240367135, 247283550, 255989130, 262659662, 267020622, 273204804, 279279333, 286917385, 292934005, 298982946, 305001541, 311053183, 317129227, 323196354, 329289435, 335522845, 342046777, 348956287, 356287693, 363996317, 371999662, 380192587, 388376106, 396573248, 404783020, 412953000, 421030035, 428974903, 436738031, 444322417 ] }, { "name": "North America", "stackgroup": "World", "type": "scatter", "uid": "5a04cdc9-d117-4c65-b8f3-3b28d7e696b4", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 198624409, 202007500, 205198600, 208253700, 211262900, 214031100, 216659000, 219176000, 221503000, 223759000, 226431000, 229361135, 231943831, 234332208, 236681487, 239235000, 241606200, 244088400, 246674600, 249385800, 251872670, 254421050, 256921449, 259303930, 261583423, 263922898, 266394382, 268896849, 271452347, 274256841, 277473326, 281211703, 285092192, 288811320, 292297226, 295691746, 299126029, 302704697, 306162843, 309600485, 312993944, 316113359, 319050105, 321847258, 324864038, 327892753, 331014940, 334184023, 337405012, 340465736, 343408819, 346051624, 348808615, 351451876, 354223012, 356937591, 359735880, 362492702 ] }, { "line": { "dash": "dash" }, "name": "Total", "type": "scatter", "uid": "e19ef556-c9eb-4516-b0d8-edc84dcf2420", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 3032160395, 3073368589, 3126509809, 3191786428, 3257459749, 3324545319, 3394783653, 3464689185, 3535355316, 3610178793, 3685753341, 3763393039, 3840269676, 3916243701, 3992871281, 4067740568, 4140647339, 4213305195, 4287155675, 4362863944, 4439337768, 4517802648, 4599181616, 4681262096, 4763043102, 4846338372, 4932113625, 5020001104, 5108813278, 5197758286, 5288103214, 5375488619, 5459753865, 5544873088, 5628791176, 5713794372, 5796632117, 5879433900, 5961166037, 6041818586, 6121682736, 6201340258, 6280530065, 6359899296, 6439825381, 6520298763, 6601476541, 6683223772, 6766296679, 6849569339, 6932869743, 7014983968, 7099557649, 7185137526, 7271322821, 7357559450, 7444157356, 7530360149 ] } ], "layout": { "title": "Population, total", "yaxis": { "title": "Population" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "metric_name = 'Population, total'\n", "metric = world_bank_data[metric_name].dropna()\n", "data = [go.Scatter(x=metric.loc[region].index.date, y=metric.loc[region], name=region,\n", " stackgroup='World') for region in zones]\n", "add_line(metric_name, 'Total', line=dict(dash='dash'))\n", "offline.iplot(go.Figure(data=data,\n", " layout=go.Layout(\n", " title=metric_name,\n", " yaxis=dict(title='Population'))), show_link=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Gross domestic product" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "name": "East Asia & Pacific", "stackgroup": "World", "type": "scatter", "uid": "e9c2d8e0-fef1-42a2-b446-39cfd3fb8d0f", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 1335193904234.98, 1413847881858.86, 1502289636789.42, 1620052495953.56, 1792109344720.52, 1910414175609.39, 2082206144452.99, 2260330288297.26, 2495818664560.14, 2785978536131.32, 2873439175786.75, 3021081222042.87, 3246209159883.31, 3496828800806.81, 3517274691784.27, 3637226726095.64, 3790067980457.9, 3981500234296.75, 4205907678521.82, 4450640334931.84, 4610203456232.16, 4820895562348.62, 5010031510928.63, 5214896816776.45, 5515253622475.01, 5818745937749.07, 6083757136183.66, 6436317260951.14, 6916265581013.21, 7269458339892.13, 7640505102569.75, 7980114560167.26, 8253649882900.4, 8514084571922.51, 8881341905577.29, 9335154544809.34, 9810068794695.02, 10150448823097.2, 10140725427055, 10444102434438.4, 10954043121487, 11247238359547, 11652899379784, 12148737870605.3, 12773430339023, 13418481526293.6, 14161880381201.1, 15077105123731.8, 15607897837047.1, 15825159520890.6, 16943264970899.9, 17725530733311, 18555475956759.4, 19436792754936.9, 20239079223781.5, 21081950387837.8, 21947483243308.1, 22946631856266 ] }, { "name": "South Asia", "stackgroup": "World", "type": "scatter", "uid": "7c32585c-f58d-4d73-8d38-92f2724e0e19", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 178281304948.389, 185625510836.39, 191800469736.25, 202078021659.484, 217637164397.108, 215565552688.786, 217754136887.01, 231632278919.7, 241811253859.881, 256082699783.538, 270748944570.661, 272844656200.909, 268473630702.18, 278593586112.83, 284925110016.887, 305617476690.411, 313056950003.414, 333095237955.904, 353239473774.542, 342678942385.023, 364939023631.008, 388121449449.595, 402754568657.319, 429917144510.959, 447812086153.738, 472004384614.749, 494707392552.029, 515374977075.285, 559392537388.221, 589918810243.708, 621900576627.048, 633827785908.029, 670103222409.794, 699599598419.073, 741977643159.599, 793539804914.072, 847896642558.429, 880084010464.108, 929312197149.429, 1001376239354.69, 1042212931499.57, 1086974818633.49, 1127381049134.91, 1209007847770.54, 1300065838167.33, 1414085329452.83, 1536714819578.81, 1675158979399.88, 1740166471463.11, 1872575948128.08, 2042144113594.69, 2171080898032.74, 2290882811287.07, 2430009982186.33, 2599882607029.26, 2797619174158.54, 2988827716871.23, 3182405851619.85 ] }, { "name": "Sub-Saharan Africa", "stackgroup": "World", "type": "scatter", "uid": "61bf3665-8ec0-45d0-b02a-2b2939ed1a5d", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 246064821458.968, 249651662855.473, 264367476446.236, 281033795142.693, 296142423583.591, 310857815422.015, 315950578313.46, 314764854235.128, 324389774697.676, 353365593797.873, 388060476462.849, 416927565590.565, 427999247754.856, 446651773781.378, 481833701513.673, 481630443373.734, 506849271779.106, 518845804274.089, 517628187703.441, 538487365789.32, 559977932932.596, 558395884550.266, 559696133579.668, 552786279702.826, 565508162789.018, 578401639889.59, 575991942404.697, 575112058538.452, 600456556285.324, 620138396777.461, 634278624539.819, 635204800754.451, 626768893587.896, 627968214535.761, 639548339057.689, 660635858571.185, 695531451777.834, 720532000334.132, 737745477533.351, 753479897096.53, 780514800542.022, 811240377707.151, 842151201660.063, 882984159286.223, 986002090378.835, 1041526246795.37, 1114210954690, 1194000989573.99, 1258383150217.98, 1294326408511.99, 1364274589504.98, 1425256515973.13, 1486630057438.21, 1558016285155.67, 1631006343583.76, 1681673387272.76, 1703967593621.58, 1748512467862.22 ] }, { "name": "Europe & Central Asia", "stackgroup": "World", "type": "scatter", "uid": "6f013d57-1de4-4c44-b412-efa4dbe162de", "x": [ "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 8453031871455.07, 8767577822627.51, 9187277517863.79, 9739344390601.2, 9967315006780.82, 9920315447621.45, 10393345713219.7, 10690608879202.5, 11032558295332.4, 11444124602959.4, 11609198834582, 11668544447207.4, 11779300586742.1, 12005543720112.2, 12325213913832.1, 12666198990828, 13016657446203.1, 13412263784032.8, 13973809063268.8, 14471108596808.6, 14807194865231.4, 14872437878164.3, 14782519552285.9, 14658559258279, 14816432355831.3, 15136143786009, 15404296214871.3, 15862503298830.5, 16255730656131.4, 16728053077411.6, 17447463797701.5, 17831522068558.5, 18142763624927.2, 18482316683699.6, 19082602935765.6, 19609019522797.8, 20380625847278.4, 21135125374177.4, 21347723177487.1, 20393898420573.4, 20919626535010.4, 21422680355289.5, 21485163377517.2, 21676874836869.5, 22074385861143.9, 22508837810666, 22919112711678.3, 23513852147168.1 ] }, { "name": "Latin America & Caribbean", "stackgroup": "World", "type": "scatter", "uid": "59adb1eb-95d2-4e73-8069-4e620cb26f34", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 805595533203.24, 858359878443.041, 899499713330.828, 922732689084.603, 991556810858.053, 1043051288929.99, 1085916594738.19, 1133814366214.65, 1222563216147.42, 1299391514524.29, 1385481979163.2, 1477820216672.3, 1583931677284.3, 1720534273211.46, 1830165810413.41, 1898329596441.56, 2015236087569.35, 2112823421894.16, 2195315997019.91, 2339922629421.83, 2486195531817.41, 2494783954860.1, 2474556255128.86, 2406379860596.92, 2500584761477.43, 2589571764722.05, 2705854833811.18, 2798247502975.5, 2823563805494.51, 2862361270121.76, 2873424549865.91, 2980376663915.49, 3065736350145.29, 3185774080530.51, 3332554683243.8, 3382398170678.35, 3501672702335.3, 3681398960027.42, 3763506821216.73, 3768594622603.36, 3910101847842.52, 3944670910543.06, 3956267058040.41, 4017745109679.9, 4272693475591.03, 4454352737450.49, 4688780267630.19, 4947528978585.54, 5142178841094.81, 5046455930945.44, 5340986877008.96, 5573569725447.7, 5729771543692.7, 5889583818131.07, 5948084735018.07, 5952902015086.65, 5924556329177.28, 6026775909646.2 ] }, { "name": "Middle East & North Africa", "stackgroup": "World", "type": "scatter", "uid": "8bdc7139-cd5d-468d-b5fb-1dbd291b06fd", "x": [ "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 453268414025.663, 506079686070.414, 603266226157.979, 673686059768.663, 782389760406.601, 874177543430.794, 961255552330.076, 938303616222.384, 1081497360218.99, 1118880062603.46, 1064840820059.05, 1114812875620.12, 1104288743055.47, 1118523046828.83, 1097131997333.84, 1070244072592.36, 1055527879421.43, 1049879796115.08, 1058340438380.9, 1059269401278.4, 1091594713912.26, 1120379525573.87, 1267656123017.69, 1321032692559.88, 1381834454734.07, 1420689567124.02, 1458778877049.6, 1502105072411.95, 1572558263588.76, 1624944035721.96, 1698206087153.29, 1729171094696.02, 1827998160235.21, 1850321948582.82, 1880767247051.59, 1983326044503.63, 2142789451782.43, 2251363948929.01, 2386297238811.04, 2509017475057.4, 2621116622716.58, 2635936338010.02, 2767867931548.18, 2868967945059.4, 2980670452080.03, 3059995410963.36, 3147997052401.34, 3227438973967.89, 3377191140658.81, 3439090418855.16 ] }, { "name": "North America", "stackgroup": "World", "type": "scatter", "uid": "9e05cf9c-8fe8-4b8f-bdf4-ce3adbf405a1", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 3395655507826.76, 3476516011345.54, 3691880712248.43, 3857011395691.75, 4084097866028.09, 4346383271596.42, 4629378699232.63, 4747161058831.39, 4977242479318.35, 5141981563975.33, 5307190813563.58, 5486409376493.67, 5776089414948.02, 6109557341951.07, 6103949820380.8, 6104904944804.73, 6432596233366.38, 6721204640882.49, 7083497281559.07, 7313051945243.64, 7313827589551.57, 7510674955912.27, 7356597565360.47, 7681382789497.46, 8228045496685.55, 8580817559320.69, 8870218790551.68, 9183070931019.7, 9571255380036.66, 9909983241268.39, 10082249972005.5, 10053845569291.6, 10384644150401.9, 10668893761216.6, 11104222509286.6, 11405763561375.2, 11814571232417.7, 12342376721467, 12884939253540, 13494369950584.7, 14060741014235, 14208952809824.1, 14479294373341.5, 14871587432840.9, 15424480380796.4, 15938245426101.8, 16362761724328.5, 16658294282445.3, 16630456481712.4, 16165910684040.7, 16583580836811.1, 16873719088056.7, 17240639956499, 17543107427996.8, 17998797135482.9, 18480631549886.3, 18753837183579, 19194328508917.2 ] }, { "line": { "dash": "dash" }, "name": "Total", "type": "scatter", "uid": "b1e29be2-deef-47b6-a0d7-aa82567da5d8", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-01-01", "2017-01-01" ], "y": [ 11209512349833.6, 11696124718582.5, 12347425977247.2, 12991453902536.6, 13858344377638.6, 14630487784731.9, 15478277751841.2, 16164308913775.3, 17168002763810.3, 18223622639759.2, 19109635180959.6, 19938069636431.3, 21089782385353.4, 22474704209582.5, 22928326716437.3, 23097437303228, 24334345559322.4, 25296504195392.2, 26297768657774.9, 27390873628793.6, 27905328695098.7, 28444838905749.3, 28554277296974.7, 29250940954128.3, 30571684161653.1, 31714547524791.9, 32780630144344.9, 33973127604593.4, 35540930244406.8, 36852406856046.5, 37929171026566.5, 38477308216255.8, 39166489201253.3, 39778851977682.5, 40981237840174.8, 42223378195131, 43652916224783.8, 45269306059637.5, 46415713367103.6, 47926871281531.9, 50030243606278.9, 50988041847854.4, 52088686031926.7, 53601904514667.3, 55986223799486.2, 58130521241554, 60633416704438.7, 63197033745706.5, 64346304540772.7, 63230507201930.5, 65956672976970.8, 68054676805588.4, 69761542035193.2, 71585710669515, 73630022741252.2, 75733592383077.8, 77631270126103, 80077827258147 ] } ], "layout": { "title": "GDP (constant 2010 US$)" } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "metric_name = 'GDP (constant 2010 US$)'\n", "metric = world_bank_data[metric_name].dropna()\n", "data = [go.Scatter(x=metric.loc[region].index.date, y=metric.loc[region], name=region,\n", " stackgroup='World') for region in zones]\n", "add_line(metric_name, 'Total', line=dict(dash='dash'))\n", "offline.iplot(go.Figure(data=data,\n", " layout=go.Layout(\n", " title=metric_name)), show_link=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CO2 emissions versus GDP" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Over time, CO2 emissions to create a value of \\$1 tend to decrease: production becomes more CO2 efficient over time. But we need to innovate even more to actually decrease the CO2 emissions!" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "name": "East Asia & Pacific", "type": "scatter", "uid": "ddce9b84-f929-4e0d-9a95-5f2aed831f65", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.90628920733178, 0.736416214531681, 0.631406314112999, 0.612199064509028, 0.58367064266102, 0.593918963595875, 0.590904247549598, 0.549281190264981, 0.5516882341529, 0.57737346400636, 0.686122669711507, 0.704063041674332, 0.697473954423381, 0.689985462021833, 0.692015659907727, 0.70662144129402, 0.712902699255768, 0.729267610534095, 0.732573921052116, 0.719681134606546, 0.692767136901876, 0.655758225498193, 0.654671932219757, 0.648010599360159, 0.655256270722191, 0.650081646797779, 0.64318938082976, 0.636069465203265, 0.639250480815836, 0.627146943758296, 0.615637980542923, 0.615654984821097, 0.624812888547757, 0.639869112312215, 0.648340567800671, 0.655810565098313, 0.653725014899378, 0.642673875423538, 0.609841887665806, 0.604490657398186, 0.597725651859665, 0.594067029304689, 0.612122021369967, 0.650298404239432, 0.682355264579241, 0.698582345895726, 0.708169547263929, 0.705366253412546, 0.719178191606765, 0.73497383830244, 0.742756381747536, 0.775933259071224, 0.760394746138307, 0.73356440305893, 0.705176086507667 ] }, { "name": "South Asia", "type": "scatter", "uid": "4b6c213f-4018-40d1-85ff-c2d5509ee35d", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.782402236621628, 0.808706162995406, 0.861730439103276, 0.883295917111281, 0.806199410222449, 0.893231121015516, 0.913348778870509, 0.868342864415964, 0.909561415591604, 0.873079703172886, 0.843016480536256, 0.870969388929164, 0.914941483666559, 0.914204409920802, 0.924301147008038, 0.934755558136455, 0.949615365500617, 0.945441195534865, 0.90937043237989, 0.987582606169475, 0.985100676335163, 0.998954264315538, 0.999980239436276, 1.01226999564077, 0.99958673926082, 1.04311973585132, 1.06360683289094, 1.09072576280296, 1.08489321082741, 1.12011809172014, 1.14274204062394, 1.18374457333884, 1.19083624330343, 1.18260293726527, 1.18260853826192, 1.1701279082031, 1.19368047731154, 1.19270289826815, 1.15110247802762, 1.13329247729237, 1.13326204972394, 1.10146817154897, 1.0802153965019, 1.05058413089893, 1.03111664166924, 1.0014869941038, 0.983055304571117, 0.972623767675887, 1.03327017356461, 1.05564193109288, 0.964295479878574, 0.96807895178133, 0.99703002997205, 0.947708866581691, 0.967903219628593 ] }, { "name": "Sub-Saharan Africa", "type": "scatter", "uid": "0b35f6d3-56ca-4538-864d-0b20da09a7f2", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.512412980418609, 0.528251055086386, 0.516341139490395, 0.509216525808358, 0.530429588314555, 0.560884000714215, 0.563071393221902, 0.587603401296578, 0.582699889118315, 0.580680451467146, 0.583048830720769, 0.624625173919431, 0.641526207235592, 0.653220089992697, 0.642704983276612, 0.624327689879803, 0.624041569504495, 0.614663258527615, 0.626464026815594, 0.679138287107356, 0.67591397346211, 0.723737045717784, 0.761944907907048, 0.783778178808335, 0.822080416833488, 0.824084205327649, 0.838026530378081, 0.826331991679212, 0.842533101252581, 0.776436323031104, 0.691857232194683, 0.713890748812491, 0.697998595141563, 0.730121066119574, 0.729799604368375, 0.757994926134123, 0.734821807745521, 0.739492119500794, 0.704462844396638, 0.695240471438735, 0.723274709800589, 0.706655762237237, 0.678067328563193, 0.70883698166688, 0.700588375495706, 0.636689965079683, 0.624648950836839, 0.603926155287191, 0.599953717599535, 0.574812040031348, 0.54725926702131, 0.531678308572955, 0.51630328354285, 0.503274060583331, 0.504485489778223 ] }, { "name": "Europe & Central Asia", "type": "scatter", "uid": "549ac707-3b74-40c6-80da-d63801bb74ca", "x": [ "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.517122989246213, 0.4963168503623, 0.460070144397211, 0.447657136476383, 0.442913850590621, 0.414119264621796, 0.403092246344149, 0.388957614281321, 0.375823320730816, 0.372428354302096, 0.365350910170618, 0.369022987673585, 0.359709104180621, 0.35016631337937, 0.343595541218146, 0.329873158533683, 0.326006301631686, 0.313377580097222, 0.320456164630731, 0.311928247654059, 0.311156625752563, 0.302237708625679, 0.282952010369122 ] }, { "name": "Latin America & Caribbean", "type": "scatter", "uid": "2540c232-ac5f-42fc-b9cd-263ef898807b", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.361536952988636, 0.346928620254634, 0.351166831982718, 0.342579162430306, 0.345099912637428, 0.339772543945837, 0.343463303145092, 0.353168094140471, 0.349469672082364, 0.355788611287798, 0.368121464627184, 0.363959948156687, 0.356341787982254, 0.358077150519425, 0.356140086615595, 0.349731257593265, 0.34506695851464, 0.344198773150605, 0.356866997808224, 0.358444373701877, 0.35451802844117, 0.34975516047783, 0.361884092169621, 0.357067562428299, 0.345942560896488, 0.343709349499266, 0.341481528562095, 0.346742137156899, 0.351844056027902, 0.367449375984094, 0.352405581593413, 0.346041920489346, 0.343016054210189, 0.342054417582215, 0.338957592276047, 0.337282409711375, 0.341576335339275, 0.342827180195394, 0.356249587793558, 0.362243239770145, 0.347100458475096, 0.352136919332019, 0.355322101829234, 0.358452835416884, 0.339309841734818, 0.342774412429621, 0.335418938732887, 0.323536227502641, 0.327043026143823, 0.326148701917822, 0.324444041496467, 0.317375716534756, 0.322425982631298, 0.318314779866833, 0.321537366937333 ] }, { "name": "Middle East & North Africa", "type": "scatter", "uid": "44fff6e3-6ad9-4e52-85fb-cf89ded49d71", "x": [ "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.600234770779294, 0.606588179565068, 0.537178043733424, 0.540062591872848, 0.499169243009609, 0.528470358286903, 0.487237436278221, 0.492411982098355, 0.504440318932692, 0.5135195668501, 0.568802996766262, 0.571584419842649, 0.585306432719589, 0.561335428762797, 0.578448677272578, 0.632836088708366, 0.68709496953569, 0.731503222972632, 0.773899330846573, 0.784066777048964, 0.812864812653137, 0.818366824928225, 0.720800156596184, 0.756939505059791, 0.769147227521102, 0.815164125017128, 0.830774210384645, 0.790068754250828, 0.754970959109101, 0.709896976536479, 0.746521824171018, 0.782739026896548, 0.805818042951675, 0.809007538470001, 0.805983903311999, 0.814737054191415, 0.815504222100041, 0.814395202904537, 0.813791268923215, 0.768546108653901, 0.796156877917616, 0.828570035818405, 0.820515826320404, 0.800895041004868, 0.828297233690199, 0.79913636773401, 0.823785362519992 ] }, { "name": "North America", "type": "scatter", "uid": "f4f759f8-acce-4c69-bdb7-76974f45c4e7", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.908145415485217, 0.884467044295279, 0.865290973080886, 0.863489906905676, 0.855512866883874, 0.838227083839718, 0.825466932664947, 0.837936302919375, 0.830805056450921, 0.842544408239887, 0.880054576342594, 0.85841366380317, 0.85634805915561, 0.843308451763323, 0.817323586989901, 0.786896993717837, 0.779294677784649, 0.766365480031521, 0.749232036527568, 0.730792858715561, 0.706453624143578, 0.661217861264346, 0.641866776189303, 0.618510581779095, 0.595673848421758, 0.572799202176384, 0.552516040666364, 0.557579754905741, 0.558884392548672, 0.546836101743639, 0.521618362627634, 0.522005869279508, 0.515277589727803, 0.513154826782685, 0.499966145253037, 0.491075362632245, 0.485168690106329, 0.475154358301173, 0.458524866260181, 0.446154381200965, 0.442976856176658, 0.431013421465209, 0.425518092673333, 0.418876864970292, 0.409015862528152, 0.398270146888591, 0.381461179118658, 0.380838232560551, 0.371354151209931, 0.358825848996345, 0.357631533705626, 0.345343963804905, 0.32698152674286, 0.323590335822746, 0.321801977009982 ] }, { "line": { "dash": "dash" }, "name": "Total", "type": "scatter", "uid": "9c1e3664-93d5-4edb-b705-7857cdb86b74", "x": [ "1960-01-01", "1961-01-01", "1962-01-01", "1963-01-01", "1964-01-01", "1965-01-01", "1966-01-01", "1967-01-01", "1968-01-01", "1969-01-01", "1970-01-01", "1971-01-01", "1972-01-01", "1973-01-01", "1974-01-01", "1975-01-01", "1976-01-01", "1977-01-01", "1978-01-01", "1979-01-01", "1980-01-01", "1981-01-01", "1982-01-01", "1983-01-01", "1984-01-01", "1985-01-01", "1986-01-01", "1987-01-01", "1988-01-01", "1989-01-01", "1990-01-01", "1991-01-01", "1992-01-01", "1993-01-01", "1994-01-01", "1995-01-01", "1996-01-01", "1997-01-01", "1998-01-01", "1999-01-01", "2000-01-01", "2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01", "2007-01-01", "2008-01-01", "2009-01-01", "2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01" ], "y": [ 0.838261663991965, 0.806609082418982, 0.795196463309752, 0.797102888752387, 0.789904783177735, 0.781463826724818, 0.775890392622748, 0.766484087385975, 0.758224109471832, 0.757100665917999, 0.773892236767305, 0.768538571457347, 0.756631445049053, 0.748490806380784, 0.734934663806918, 0.725006486787157, 0.728439491984167, 0.72262175733079, 0.703402129500866, 0.713140742194733, 0.692495955705911, 0.658335487855937, 0.650072625090277, 0.631923497400901, 0.626261388602699, 0.621772741565526, 0.619736592205341, 0.612753474018842, 0.606776557751856, 0.597773308051535, 0.583967479370588, 0.582263414662018, 0.566387693750456, 0.557134594342588, 0.550293056592158, 0.545610633605262, 0.539976677677661, 0.529608457359949, 0.519526476072445, 0.501997863759385, 0.493499715777945, 0.495736452782873, 0.492371759661593, 0.504605055452811, 0.507152993595195, 0.507306890943881, 0.504146288654755, 0.493385514349688, 0.500131161061601, 0.504375188675164, 0.507490364343985, 0.512051524387498, 0.508459101751301, 0.500624924511109, 0.490809097356872 ] } ], "layout": { "title": "CO2 emissions (kg per 2010 US$ of GDP)" } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "metric_name = 'CO2 emissions (kg per 2010 US$ of GDP)'\n", "metric = world_bank_data[metric_name].dropna()\n", "data = [go.Scatter(x=metric.loc[region].index.date, y=metric.loc[region], name=region) for region in zones]\n", "add_line(metric_name, 'Total', line=dict(dash='dash'))\n", "offline.iplot(go.Figure(data=data,\n", " layout=go.Layout(\n", " title=metric_name)), show_link=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What can I do?\n", "\n", "This is probably the perfect time to make our best effort!\n", "\n", "## Spread the word, and expose data\n", "\n", "This is a global issue. People need to stay informed. Sharing information and progresses on this issue is crucial!\n", "\n", "## Change habits\n", "\n", "At an individual level, we also need to identify activities and consumption habits that cause CO2 emissions.\n", "\n", "## Preserve the environement\n", "\n", "Forest are natural carbon sinks, and NASA finds that they [remove as much as 30%](https://www.nasa.gov/jpl/nasa-finds-good-news-on-forests-and-carbon-dioxide) of human CO2 emissions.\n", "\n", "## Innovate\n", "\n", "Identifying more efficient CO2 processes could allow to preserve growth, and still reduce emissions." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "hide_input": false, "jupytext": { "formats": "ipynb,py:light", "text_representation": { "extension": ".py", "format_name": "light", "format_version": "1.3", "jupytext_version": "0.8.4" } }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 2 }