<jupyter_start><jupyter_text>0. Data preparation for scenario analysisLicensed under the [MIT License](https://github.com/iiasa/ENGAGE-netzero-analysis/blob/main/LICENSE).This notebook is part of a repository to generate figures and analysis for the manuscript> <NAME>, <NAME>, <NAME>, et al. > Cost and attainability of meeting stringent climate targets without overshoot > **Nature Climate Change**, 2021 > doi: [10.1038/s41558-021-01215-2](https://doi.org/10.1038/s41558-021-01215-2)The scenario data used in this analysis should be cited as> ENGAGE Global Scenarios (Version 2.0) > doi: [10.5281/zenodo.5553976](https://doi.org/10.5281/zenodo.5553976)The data can be accessed and downloaded via the **ENGAGE Scenario Explorer** at [https://data.ece.iiasa.ac.at/engage](https://data.ece.iiasa.ac.at/engage).*Please refer to the [license](https://data.ece.iiasa.ac.at/engage//license)of the scenario ensemble before redistributing this data or adapted material.*The source code of this notebook is available on GitHubat [https://github.com/iiasa/ENGAGE-netzero-analysis](https://github.com/iiasa/ENGAGE-netzero-analysis).A rendered version can be seen at [https://data.ece.iiasa.ac.at/engage-netzero-analysis](https://data.ece.iiasa.ac.at/engage-netzero-analysis).<jupyter_code>from pathlib import Path
from pyam import IamDataFrame<jupyter_output><empty_output><jupyter_text>Import the full scenario snapshot at the global and five-region resolution<jupyter_code>data_folder = Path("../data/")
source_folder = data_folder / "ENGAGE_2.0"
all_data = IamDataFrame(source_folder / "ENGAGE_scenario_data_world_r2.0.csv")
all_data.append(source_folder / "ENGAGE_scenario_data_r5_regions_r2.0.csv", inplace=True)<jupyter_output><empty_output><jupyter_text>Downselect to the scenarios and variables relevant for this analysis<jupyter_code>df = all_data.filter(scenario=["*_COV*", "*_NDCp", "*_lowBECCS"], keep=False)
df.filter(region="Other (R5)", keep=False, inplace=True)
variable_list = [
    "Price|Carbon",
    "GDP|*",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|1.0 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|1.5 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|2.0 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|2.5 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|3.0 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|3.5 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Exceedance Probability|4.0 degC|MAGICC6",
    "AR5 climate diagnostics|Temperature|Global Mean|MAGICC6|Expected value",
    "AR5 climate diagnostics|Temperature|Global Mean|MAGICC6|MED",
    "Emissions|Kyoto Gases",
    "Emissions|CO2",
    "Emissions|CO2|AFOLU",
    "Emissions|CO2|Energy|Demand",
    "Emissions|CO2|Energy|Demand|Industry",
    "Emissions|CO2|Energy|Demand|Transportation",
    "Emissions|CO2|Energy|Demand|Residential and Commercial",
    "Emissions|CO2|Energy|Supply",
    "Emissions|CO2|Industrial Processes",
    "Carbon Sequestration|CCS",
    "Carbon Sequestration|CCS|Biomass",
    "Carbon Sequestration|CCS|Biomass|Energy|Demand|Industry",
    "Carbon Sequestration|CCS|Fossil|Energy|Demand|Industry",
    "Carbon Sequestration|CCS|Biomass|Energy|Supply",
    "Carbon Sequestration|CCS|Fossil|Energy|Supply",
    "Carbon Sequestration|CCS|Industrial Processes",
    "Carbon Sequestration|Land Use",
    "Carbon Sequestration|Direct Air Capture",
    "Carbon Sequestration|Other",
    "Primary Energy|Fossil|w/ CCS",
    "Primary Energy|Non-Biomass Renewables",
    "Primary Energy|Nuclear",
    "Primary Energy|Biomass|Modern",
    "Final Energy*",
    "Secondary Energy*",
]
df.filter(variable=variable_list, inplace=True)<jupyter_output><empty_output><jupyter_text>Export down-selected data for further processing<jupyter_code>df.to_csv(data_folder / "ENGAGE_snapshot_selected.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.124, 'fraction_numerical': 0.03025, 'mean_word_length': 6.381918819188192, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 26, 'https://': 10, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '129703', 'license': 'MIT', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1337, 'n_words': 256, 'path': 'assessment/0_data_preparation.ipynb', 'repo_name': 'iiasa/ENGAGE-netzero-analysis', 'size': '4026'}