<jupyter_start><jupyter_text>*Assessment of pathways using the IAMC 1.5°C Scenario Data* Economic growth per capitaThis notebook computes the variable "GDP/capita" and plots a number of figures for all pathways and for pathways limiting global warming to below 1.5°C by the end of the century.The scenario data used in this analysis can be accessed and downloaded at [https://data.ene.iiasa.ac.at/iamc-1.5c-explorer](https://data.ene.iiasa.ac.at/iamc-1.5c-explorer).  Load ``pyam`` package and other dependences<jupyter_code>import pandas as pd
import numpy as np
import warnings
import io
import itertools
import yaml
import math
import matplotlib.pyplot as plt
plt.style.use('../assessment/style_sr15.mplstyle')
%matplotlib inline
import pyam<jupyter_output><empty_output><jupyter_text>Import scenario data, categorization and specifications filesThe metadata file must be generated from the notebook `sr15_2.0_categories_indicators`in the repository https://github.com/iiasa/ipcc_sr15_scenario_analysis.If the snapshot file has been updated, make sure that you rerun the categorization notebook.The last cell of this section loads and assigns a number of auxiliary lists as defined in the categorization notebook.<jupyter_code>sr1p5 = pyam.IamDataFrame(data='../data/iamc15_scenario_data_world_r1.1.xlsx')
sr1p5.load_metadata('../assessment/sr15_metadata_indicators.xlsx')
with open("../assessment/sr15_specs.yaml", 'r') as stream:
    specs = yaml.load(stream, Loader=yaml.FullLoader)

rc = pyam.run_control()
for item in specs.pop('run_control').items():
    rc.update({item[0]: item[1]})
cats = specs.pop('cats')
cats_15 = specs.pop('cats_15')
cats_15_no_lo = specs.pop('cats_15_no_lo')
cats_2 = specs.pop('cats_2')<jupyter_output><empty_output><jupyter_text>Downselect scenario ensemble to categories of interest for this assessment<jupyter_code>df = sr1p5.filter(category=cats, year=range(2010, 2101, 10))<jupyter_output><empty_output><jupyter_text>Compute 'GDP/capita' and append to `IamDataFrame`<jupyter_code>pop = (
    df.filter(variable='Population')
    .convert_unit({'million': ['billion', 1/1000]})
    .timeseries()
)
pop.index = pop.index.droplevel([2, 3, 4])

gdp = (
    df.filter(variable='GDP|PPP')
    .convert_unit({'billion US$2010/yr': ['trillion US$2010/yr', 1/1000]})
    .timeseries()
)
gdp.index = gdp.index.droplevel([2, 3, 4])
gdp_pop = gdp / pop
gdp_pop['variable'] = 'GDP/capita'
gdp_pop['unit'] = 'billion US$2010/yr/cap'
gdp_pop['region'] = 'World'<jupyter_output><empty_output><jupyter_text>Remove scenarios that don't report GDP<jupyter_code>gdp_pop = gdp_pop[gdp_pop[2020] > 1]
df.data = df.data.append(pyam.IamDataFrame(gdp_pop).data)
gdp_pop = df.filter(variable='GDP/capita')<jupyter_output><empty_output><jupyter_text>Draw figures for all pathways<jupyter_code>gdp_pop.line_plot(color='category', fill_between=True, final_ranges=True)
gdp_pop.line_plot(color='category', final_ranges=True)
gdp_pop.line_plot(color='category', linewidth=0.5, final_ranges=True)<jupyter_output><empty_output><jupyter_text>Draw figures only for pathways limiting global warming to 1.5°C by the end of the century<jupyter_code>gdp_pop_15 = df.filter(variable='GDP/capita', category=cats_15)
gdp_pop_15.line_plot(color='category', fill_between=True, final_ranges=True)
gdp_pop_15.line_plot(color='category', final_ranges=True)
gdp_pop_15.line_plot(color='category', linewidth=0.5, final_ranges=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12485515643105446, 'fraction_numerical': 0.029258400926998843, 'mean_word_length': 7.0116009280742455, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '247891', 'license': 'Apache-2.0', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1219, 'n_words': 260, 'path': 'further_analysis/iamc15_gdp_per_capita.ipynb', 'repo_name': 'joshicct/ipcc_sr15_scenario_analysis', 'size': '3452'}