PRIMAP-hist

National historical emissions time series

In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use("ggplot")
In [2]:
import pandas as pd
from zipfile import ZipFile
In [3]:
!wget --no-clobber ftp://datapub.gfz-potsdam.de/download/10.5880.PIK.2019.001/PRIMAP-hist_v2.0_11-Dec-2018.zip
File ‘PRIMAP-hist_v2.0_11-Dec-2018.zip’ already there; not retrieving.
In [4]:
zip_file = ZipFile('PRIMAP-hist_v2.0_11-Dec-2018.zip')
In [5]:
df = pd.read_csv(zip_file.open("PRIMAP-hist_v2.0_11-Dec-2018.csv"))
In [6]:
df.head()
Out[6]:
scenario country category entity unit 1850 1851 1852 1853 1854 ... 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
0 HISTCR ABW IPC1A CH4 Gg 0.000366 0.000378 0.000390 0.000402 0.000415 ... 0.22300 0.23400 0.23900 0.24600 0.24300 0.24300 0.28000 0.29100 0.30200 0.31400
1 HISTCR AFG IPC1A CH4 Gg 0.031700 0.031900 0.032100 0.032300 0.032400 ... 9.16000 9.98000 10.80000 11.20000 11.80000 12.00000 12.00000 12.30000 12.70000 13.00000
2 HISTCR AGO IPC1A CH4 Gg 1.750000 1.770000 1.800000 1.820000 1.840000 ... 61.60000 63.60000 65.80000 67.90000 69.90000 69.90000 72.80000 74.60000 76.50000 78.30000
3 HISTCR AIA IPC1A CH4 Gg 0.000120 0.000120 0.000121 0.000123 0.000124 ... 0.00159 0.00194 0.00252 0.00287 0.00303 0.00304 0.00251 0.00254 0.00256 0.00259
4 HISTCR ALB IPC1A CH4 Gg 0.060200 0.060600 0.061500 0.063000 0.065200 ... 5.09000 5.14000 5.14000 5.04000 4.95000 4.91000 5.21000 5.27000 5.33000 5.38000

5 rows × 172 columns

In [7]:
df = df.set_index(df.columns[:5].tolist())
df.head()
Out[7]:
1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 ... 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
scenario country category entity unit
HISTCR ABW IPC1A CH4 Gg 0.000366 0.000378 0.000390 0.000402 0.000415 0.000428 0.000441 0.000454 0.000468 0.000482 ... 0.22300 0.23400 0.23900 0.24600 0.24300 0.24300 0.28000 0.29100 0.30200 0.31400
AFG IPC1A CH4 Gg 0.031700 0.031900 0.032100 0.032300 0.032400 0.032600 0.032800 0.033000 0.033200 0.033400 ... 9.16000 9.98000 10.80000 11.20000 11.80000 12.00000 12.00000 12.30000 12.70000 13.00000
AGO IPC1A CH4 Gg 1.750000 1.770000 1.800000 1.820000 1.840000 1.860000 1.880000 1.900000 1.930000 1.950000 ... 61.60000 63.60000 65.80000 67.90000 69.90000 69.90000 72.80000 74.60000 76.50000 78.30000
AIA IPC1A CH4 Gg 0.000120 0.000120 0.000121 0.000123 0.000124 0.000127 0.000130 0.000133 0.000137 0.000141 ... 0.00159 0.00194 0.00252 0.00287 0.00303 0.00304 0.00251 0.00254 0.00256 0.00259
ALB IPC1A CH4 Gg 0.060200 0.060600 0.061500 0.063000 0.065200 0.067900 0.071200 0.075100 0.079500 0.084400 ... 5.09000 5.14000 5.14000 5.04000 4.95000 4.91000 5.21000 5.27000 5.33000 5.38000

5 rows × 167 columns

In [8]:
emissions = df.loc["HISTCR", "EARTH", ["IPC1", "IPC2", "IPCMAGELV", "IPC4", "IPC5"], "KYOTOGHGAR4", "GgCO2eq"]
In [9]:
emissions
Out[9]:
1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 ... 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
scenario country category entity unit
HISTCR EARTH IPC1 KYOTOGHGAR4 GgCO2eq 2.720000e+05 275000.0 285000.0 295000.0 334000.0 341000.0 360000.0 365000.0 370000.0 390000.0 ... 31400000.0 32100000.0 31700000.0 33300000.0 34200000.0 34700000.0 34800000.0 35100000.0 35100000.0 35300000.0
IPC2 KYOTOGHGAR4 GgCO2eq 2.380000e+04 28800.0 31300.0 34900.0 38600.0 43900.0 46200.0 47400.0 48300.0 52300.0 ... 3510000.0 3520000.0 3450000.0 3720000.0 3960000.0 4050000.0 4100000.0 4230000.0 4230000.0 4320000.0
IPC4 KYOTOGHGAR4 GgCO2eq 9.470000e+04 95500.0 96400.0 97200.0 98100.0 99000.0 99800.0 101000.0 101000.0 102000.0 ... 1470000.0 1490000.0 1510000.0 1540000.0 1560000.0 1580000.0 1570000.0 1590000.0 1610000.0 1630000.0
IPC5 KYOTOGHGAR4 GgCO2eq 1.270000e-11 776.0 1550.0 2330.0 3100.0 3880.0 4660.0 5430.0 6210.0 6980.0 ... 149000.0 148000.0 147000.0 151000.0 157000.0 161000.0 160000.0 162000.0 164000.0 166000.0
IPCMAGELV KYOTOGHGAR4 GgCO2eq 1.780000e+05 188000.0 197000.0 207000.0 216000.0 225000.0 233000.0 241000.0 249000.0 257000.0 ... 2690000.0 2730000.0 2770000.0 2830000.0 2850000.0 2870000.0 2800000.0 2810000.0 2840000.0 2850000.0

5 rows × 167 columns

In [10]:
emissions = emissions.reset_index().drop(["scenario", "country", "entity", "unit"], axis=1).set_index("category").T
emissions.head()
Out[10]:
category IPC1 IPC2 IPC4 IPC5 IPCMAGELV
1850 272000.0 23800.0 94700.0 1.270000e-11 178000.0
1851 275000.0 28800.0 95500.0 7.760000e+02 188000.0
1852 285000.0 31300.0 96400.0 1.550000e+03 197000.0
1853 295000.0 34900.0 97200.0 2.330000e+03 207000.0
1854 334000.0 38600.0 98100.0 3.100000e+03 216000.0
In [11]:
emissions.plot.area(stacked=True)
plt.title("PRIMAP-hist Global Emissions GgCO2-eq");
In [ ]: