Timeseries data charts

Read in tutorial data and show a summary

This gallery uses the scenario data from the first-steps tutorial.

If you haven’t cloned the pyam GitHub repository to your machine, you can download the file from https://github.com/IAMconsortium/pyam/tree/main/doc/source/tutorials.

Make sure to place the data file in the same folder as this script/notebook.

import pyam

df = pyam.IamDataFrame("tutorial_data.csv")
df
<class 'pyam.core.IamDataFrame'>
Index:
 * model    : AIM/CGE 2.1, GENeSYS-MOD 1.0, ... WITCH-GLOBIOM 4.4 (8)
 * scenario : 1.0, CD-LINKS_INDCi, CD-LINKS_NPi, ... Faster Transition Scenario (8)
Timeseries data coordinates:
   region   : R5ASIA, R5LAM, R5MAF, R5OECD90+EU, R5REF, R5ROWO, World (7)
   variable : ... (6)
   unit     : EJ/yr, Mt CO2/yr, °C (3)
   year     : 2010, 2020, 2030, 2040, 2050, 2060, 2070, 2080, ... 2100 (10)
Meta indicators:
   exclude (bool) False (1)

A simple line chart

We show a simple line chart of the regional components of CO2 emissions for one scenario.

Then, also show the data as a wide IAMC-style dataframe.

model, scenario = "REMIND-MAgPIE 1.7-3.0", "CD-LINKS_INDCi"

data = df.filter(model=model, scenario=scenario, variable="Emissions|CO2").filter(
    region="World", keep=False
)

data.plot(color="region", title="CO2 emissions by region")
data.timeseries()
CO2 emissions by region
2010 2020 2030 2040 2050 2060 2070 2080 2090 2100
model scenario region variable unit
REMIND-MAgPIE 1.7-3.0 CD-LINKS_INDCi R5ASIA Emissions|CO2 Mt CO2/yr 13319.0940 17953.8288 18860.5696 20919.9611 21346.1127 20797.3295 20655.9721 20852.5609 19611.0956 18684.4507
R5LAM Emissions|CO2 Mt CO2/yr 3841.7418 4100.6996 3293.7924 2044.4228 2348.7068 2546.6130 2466.7808 2357.3265 2160.2127 1898.8835
R5MAF Emissions|CO2 Mt CO2/yr 3338.4200 5794.1257 7223.7294 8619.6929 10859.7901 12689.7547 13635.7874 14349.2884 14149.6996 13582.5528
R5OECD90+EU Emissions|CO2 Mt CO2/yr 13425.7405 11886.5214 9499.4507 8374.9951 7484.1184 6456.2150 5624.2110 5243.8898 4656.6352 4315.5721
R5REF Emissions|CO2 Mt CO2/yr 1437.8754 1692.1186 1856.6008 1959.4409 2085.8475 2021.2251 1720.9301 1374.2122 1067.1381 894.9409


Total running time of the script: ( 0 minutes 0.312 seconds)

Gallery generated by Sphinx-Gallery