{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Examples\n", "\n", "## Loading and navigating the model\n", "We start with importing the euromod package and creating a `Model` object from a EUROMOD model." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:42.165860Z", "iopub.status.busy": "2026-01-13T11:36:42.165860Z", "iopub.status.idle": "2026-01-13T11:36:46.236659Z", "shell.execute_reply": "2026-01-13T11:36:46.236659Z" } }, "outputs": [ { "data": { "text/plain": [ "------------------------------\n", "Model\n", "------------------------------\n", "\t countries: 28 elements\n", "\t extensions: 12 elements\n", "\t model_path: 'C:\\\\Users\\\\serruha\\\\Downloads\\\\EUROMOD_RELEASES_J0.1+\\\\EUROMOD_RELEASES_J0.1+'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from euromod import Model\n", "mod=Model(r\"C:\\Users\\serruha\\Downloads\\EUROMOD_RELEASES_J0.1+\\EUROMOD_RELEASES_J0.1+\")\n", "mod" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that every object that is related to the EUROMOD project comes with an informative description. Here we can see that the model has 3 relevant attributes to the user:\n", "- countries\n", "- extensions\n", "- model_path\n", "The countries and extensions attributes say that they contain elements. If we take a look at countries" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:46.307653Z", "iopub.status.busy": "2026-01-13T11:36:46.299572Z", "iopub.status.idle": "2026-01-13T11:36:46.368912Z", "shell.execute_reply": "2026-01-13T11:36:46.368912Z" } }, "outputs": [ { "data": { "text/plain": [ "0: AT \n", "1: BE \n", "2: BG \n", "3: CY \n", "4: CZ \n", "5: DE \n", "6: DK \n", "7: EE \n", "8: EL \n", "9: ES \n", "10: FI\n", "11: FR\n", "12: HR\n", "13: HU\n", "14: IE\n", "15: IT\n", "16: LT\n", "17: LU\n", "18: LV\n", "19: MT\n", "20: NL\n", "21: PL\n", "22: PT\n", "23: RO\n", "24: SE\n", "25: SI\n", "26: SK\n", "27: SL" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mod.countries" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We see indeed that the euromod model contains 28 countries. In a similar fashion we could have looked what kind of extensions that are stored in the model. The countries container can be indexed by both the number of the element and the country shortcode. Let us take a look at Sweden." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:46.368912Z", "iopub.status.busy": "2026-01-13T11:36:46.368912Z", "iopub.status.idle": "2026-01-13T11:36:48.500834Z", "shell.execute_reply": "2026-01-13T11:36:48.500834Z" } }, "outputs": [ { "data": { "text/plain": [ "------------------------------\n", "Country\n", "------------------------------\n", "\t ct_factors: 271 elements\n", "\t datasets: 36 elements\n", "\t extensions: 13 elements\n", "\t local_extensions: COVID\n", "\t name: 'SE'\n", "\t policies: 28 elements\n", "\t systems: 19 elements\n", "\t upratefactors: 25 elements" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mod.countries[\"SE\"]" ] }, { "cell_type": "raw", "metadata": {}, "source": [ "Here we see again an informative representation of the `Country` object, which contains several attributes that can be accessed. We can for example take a look at the first 10 policies that are stored in the country." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:48.509220Z", "iopub.status.busy": "2026-01-13T11:36:48.500834Z", "iopub.status.idle": "2026-01-13T11:36:48.751034Z", "shell.execute_reply": "2026-01-13T11:36:48.751034Z" } }, "outputs": [ { "data": { "text/plain": [ "0: setdefault_se | | DEF: SET DEFAULT \n", "1: uprate_se | | DEF: UPRATING FACTORS \n", "2: ConstDef_se | | DEF: CONSTANTS \n", "3: IlsDef_se | | DEF: INCOME CONCEPTS (standardized) \n", "4: IlsUDBdef_se | | DEF: INCOME CONCEPTS (UDB) \n", "5: ildef_se | | DEF: INCOME CONCEPTS (non-standardized) \n", "6: random_se | | DEF: Random assignment \n", "7: TransLMA_se | | DEF: Modelling labour market transitions (DO NOT S ... \n", "8: tudef_se | | DEF: ASSESSMENT UNITS \n", "9: yem_se | (with switch set for MWA) | DEF: minimum wage " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mod.countries[\"SE\"].policies[0:10]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Running a system with default configuration\n", "Say that we are interested in running the tax system for the year 2021 of Sweden. Building further on the previous example we can look at the tax-systems contained in the model for Sweden." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:48.751034Z", "iopub.status.busy": "2026-01-13T11:36:48.751034Z", "iopub.status.idle": "2026-01-13T11:36:48.821662Z", "shell.execute_reply": "2026-01-13T11:36:48.821662Z" } }, "outputs": [ { "data": { "text/plain": [ "0: SE_2006 \n", "1: SE_2007 \n", "2: SE_2008 \n", "3: SE_2009 \n", "4: SE_2010 \n", "5: SE_2011 \n", "6: SE_2012 \n", "7: SE_2013 \n", "8: SE_2014 \n", "9: SE_2015 \n", "10: SE_2016\n", "11: SE_2017\n", "12: SE_2018\n", "13: SE_2019\n", "14: SE_2020\n", "15: SE_2021\n", "16: SE_2022\n", "17: SE_2023\n", "18: SE_2024" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mod.countries[\"SE\"].systems" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In order to run the tax system we need a dataset that fits the requirement to use. The model however provides us with a list of datasets that are configured already." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:48.821662Z", "iopub.status.busy": "2026-01-13T11:36:48.821662Z", "iopub.status.idle": "2026-01-13T11:36:49.059872Z", "shell.execute_reply": "2026-01-13T11:36:49.059872Z" } }, "outputs": [ { "data": { "text/plain": [ "0: training_data | \n", "1: SE_2010_a1_2010_03_e1 | \n", "2: SE_2019_a1 | \n", "3: SE_2020_b1 | \n", "4: SE_2021_hhot | \n", "5: SE_2015_a1_2015_03_e2 | \n", "6: SE_2021_b1 | \n", "7: SE_2022_b1 | best match \n", "8: SE_2019_a1_2015_03_e2 | \n", "9: SE_2020_b1_2015_03_e2 | \n", "10: SE_2021_b1_2015_03_e2 | \n", "11: SE_2022_b1_2015_03_e2 | \n", "12: SE_training_data | " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mod.countries[\"SE\"].systems[\"SE_2021\"].datasets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we see that there are multiple datasets configured, but that PL_2020_b2 is seen as the best match dataset for this taxsystem. Provided that you have the microdata stored somewhere, you can then load it as a `pandas.DataFrame` and run the model in the following way:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:49.059872Z", "iopub.status.busy": "2026-01-13T11:36:49.059872Z", "iopub.status.idle": "2026-01-13T11:36:55.653453Z", "shell.execute_reply": "2026-01-13T11:36:55.653453Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Simulation for system SE_2021 with dataset SE_2022_b1 finished.\n" ] }, { "data": { "text/plain": [ "------------------------------\n", "Simulation\n", "------------------------------\n", "\t constantsToOverwrite: {}\n", "\t errors: []\n", "\t output_filenames: ['se_2021_std.txt']\n", "\t outputs: Pandas DataFrame of 245 variables and 20448 observations." ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "data=pd.read_csv(r\"C:\\Users\\serruha\\DATA\\2022 datasets\\SE_2022_b1.txt\",sep=\"\\t\")\n", "out = mod.countries[\"SE\"].systems[\"SE_2021\"].run(data,\"SE_2022_b1\")\n", "out" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This returned us a `Simulation` object with multiple attributes returned. The one of interest here is outputs, which contains the outputdataset(s) returned by the microsimulation model." ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:55.653453Z", "iopub.status.busy": "2026-01-13T11:36:55.653453Z", "iopub.status.idle": "2026-01-13T11:36:55.919854Z", "shell.execute_reply": "2026-01-13T11:36:55.919854Z" } }, "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", " \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", "
idhhidpersonidmotheridfatheridpartneridorighhidorigpersondagdgndec...il_means_bhope_prel_64il_means_bsail_means_bhopetprtistadtu_bho_se_HeadIDtu_bho_se_IsDependentChildtu_bho_se_IsLoneParenttu_bho_se_IsPartner
04416800.0441680001.00.00.00.04416800.0441680001.080.00.00.0...463.63000014776.555530463.6300000.00001267.583300.0441680001.00.00.00.0
14416900.0441690001.00.00.00.04416900.0441690001.080.00.00.0...10038.28969016452.41253610038.2896900.00003647.333300.0441690001.00.00.00.0
24419200.0441920001.00.00.0441920002.04419200.0441920001.080.00.00.0...6542.20500312552.1938176542.2050030.00006959.583300.0441920001.00.00.00.0
34419200.0441920002.00.00.0441920001.04419200.0441920002.080.01.00.0...11688.82500316552.94067811688.8250030.00000.000000.0441920001.00.00.01.0
44419800.0441980001.00.00.00.04419800.0441980001.080.01.00.0...6022.70500014296.7032736022.7050000.00002909.833300.0441980001.00.00.00.0
..................................................................
204437172700.0717270004.00.00.00.07172700.0717270004.018.01.04.0...0.0000000.0000000.0000000.00000.000000.0717270002.01.00.00.0
204447172800.0717280001.00.00.00.07172800.0717280001.019.00.03.0...1454.7500006289.8998703988.8000000.0000448.166670.0717280001.00.00.00.0
204457173200.0717320001.00.00.00.07173200.0717320001.019.00.00.0...0.0000000.0000000.0000000.000022617.250000.0717320001.00.00.00.0
204467173200.0717320002.00.00.00.07173200.0717320002.058.00.00.0...1170.85666332469.68251522456.8581630.00000.000000.0717320002.00.00.00.0
204477173200.0717320003.00.00.00.07173200.0717320003.056.01.00.0...0.00000033969.75336224636.8335001600.58330.000000.0717320003.00.00.00.0
\n", "

20448 rows × 245 columns

\n", "
" ], "text/plain": [ " idhh idperson idmother idfather idpartner idorighh \\\n", "0 4416800.0 441680001.0 0.0 0.0 0.0 4416800.0 \n", "1 4416900.0 441690001.0 0.0 0.0 0.0 4416900.0 \n", "2 4419200.0 441920001.0 0.0 0.0 441920002.0 4419200.0 \n", "3 4419200.0 441920002.0 0.0 0.0 441920001.0 4419200.0 \n", "4 4419800.0 441980001.0 0.0 0.0 0.0 4419800.0 \n", "... ... ... ... ... ... ... \n", "20443 7172700.0 717270004.0 0.0 0.0 0.0 7172700.0 \n", "20444 7172800.0 717280001.0 0.0 0.0 0.0 7172800.0 \n", "20445 7173200.0 717320001.0 0.0 0.0 0.0 7173200.0 \n", "20446 7173200.0 717320002.0 0.0 0.0 0.0 7173200.0 \n", "20447 7173200.0 717320003.0 0.0 0.0 0.0 7173200.0 \n", "\n", " idorigperson dag dgn dec ... il_means_bhope_prel_64 \\\n", "0 441680001.0 80.0 0.0 0.0 ... 463.630000 \n", "1 441690001.0 80.0 0.0 0.0 ... 10038.289690 \n", "2 441920001.0 80.0 0.0 0.0 ... 6542.205003 \n", "3 441920002.0 80.0 1.0 0.0 ... 11688.825003 \n", "4 441980001.0 80.0 1.0 0.0 ... 6022.705000 \n", "... ... ... ... ... ... ... \n", "20443 717270004.0 18.0 1.0 4.0 ... 0.000000 \n", "20444 717280001.0 19.0 0.0 3.0 ... 1454.750000 \n", "20445 717320001.0 19.0 0.0 0.0 ... 0.000000 \n", "20446 717320002.0 58.0 0.0 0.0 ... 1170.856663 \n", "20447 717320003.0 56.0 1.0 0.0 ... 0.000000 \n", "\n", " il_means_bsa il_means_bhope tpr tis tad \\\n", "0 14776.555530 463.630000 0.0000 1267.58330 0.0 \n", "1 16452.412536 10038.289690 0.0000 3647.33330 0.0 \n", "2 12552.193817 6542.205003 0.0000 6959.58330 0.0 \n", "3 16552.940678 11688.825003 0.0000 0.00000 0.0 \n", "4 14296.703273 6022.705000 0.0000 2909.83330 0.0 \n", "... ... ... ... ... ... \n", "20443 0.000000 0.000000 0.0000 0.00000 0.0 \n", "20444 6289.899870 3988.800000 0.0000 448.16667 0.0 \n", "20445 0.000000 0.000000 0.0000 22617.25000 0.0 \n", "20446 32469.682515 22456.858163 0.0000 0.00000 0.0 \n", "20447 33969.753362 24636.833500 1600.5833 0.00000 0.0 \n", "\n", " tu_bho_se_HeadID tu_bho_se_IsDependentChild tu_bho_se_IsLoneParent \\\n", "0 441680001.0 0.0 0.0 \n", "1 441690001.0 0.0 0.0 \n", "2 441920001.0 0.0 0.0 \n", "3 441920001.0 0.0 0.0 \n", "4 441980001.0 0.0 0.0 \n", "... ... ... ... \n", "20443 717270002.0 1.0 0.0 \n", "20444 717280001.0 0.0 0.0 \n", "20445 717320001.0 0.0 0.0 \n", "20446 717320002.0 0.0 0.0 \n", "20447 717320003.0 0.0 0.0 \n", "\n", " tu_bho_se_IsPartner \n", "0 0.0 \n", "1 0.0 \n", "2 0.0 \n", "3 1.0 \n", "4 0.0 \n", "... ... \n", "20443 0.0 \n", "20444 0.0 \n", "20445 0.0 \n", "20446 0.0 \n", "20447 0.0 \n", "\n", "[20448 rows x 245 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "outputdata_baseline = out.outputs[0]\n", "outputdata_baseline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Running a system while changing a constant\n", "One of the advantages of using the Python Connectors is the ability to run many counterfactual scenario's for the EUROMOD model. One can for example change the Tax Free income limit in Poland. There are multiple ways to do this via the euromod package in Python, but one very straightforward way is to use the constantsToOverwrite option which is a a dictionary, having the targetted constant as a key and the value to overwrite with as a value.\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:55.919854Z", "iopub.status.busy": "2026-01-13T11:36:55.919854Z", "iopub.status.idle": "2026-01-13T11:36:58.669822Z", "shell.execute_reply": "2026-01-13T11:36:58.669822Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Simulation for system SE_2021 with dataset SE_2022_b1 finished.\n" ] }, { "data": { "text/plain": [ "-10865920.25980736" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "out=mod['SE']['SE_2021'].run(data,\"SE_2022_b1\",constantsToOverwrite={(\"$tinna_rate2\",\"\"):'0.4'})\n", "outputdata_changed= out.outputs[0]\n", "sum(outputdata_changed.ils_dispy - outputdata_baseline.ils_dispy)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The optional parameter ```constantsToOverwrite``` specifies which constants to overwrite in the policy spline. `constantsToOverwrite` must be a ```dict```, where the keys are ```tuples``` of two ```str``` objects: the first string is the name of the constant and the second string is its group number (**Note:** Pass an empty string if the group number is `None`); the values are ```str``` with the new values of the constants. The default is None." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run with add-ons\n", "Run the simulation for the Swedish system SE_2022 including the Marginal Tax-Rate add-on 'MTR'." ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:36:58.677902Z", "iopub.status.busy": "2026-01-13T11:36:58.669822Z", "iopub.status.idle": "2026-01-13T11:37:03.898064Z", "shell.execute_reply": "2026-01-13T11:37:03.898064Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Simulation for system SE_2022 with dataset SE_2022_b1 finished.\n" ] }, { "data": { "text/plain": [ "------------------------------\n", "Simulation\n", "------------------------------\n", "\t constantsToOverwrite: {}\n", "\t errors: []\n", "\t output_filenames: ['se_2022_base_mtr.txt', 'se_2022_mtr.txt']\n", "\t outputs: Pandas DataFrame of 251 variables and 20448 observations., Pandas DataFrame of 38 variables and 20448 observations." ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "out =mod['SE']['SE_2022'].run(data,\"SE_2022_b1\",addons=[(\"MTR\",\"MTR\")])\n", "out" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As one can see there are two datasets returned by the model. Both of them can be accessed. The average marginal tax rate for example can then be straightforwardly computed as" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:37:03.898064Z", "iopub.status.busy": "2026-01-13T11:37:03.898064Z", "iopub.status.idle": "2026-01-13T11:37:03.967180Z", "shell.execute_reply": "2026-01-13T11:37:03.967180Z" } }, "outputs": [ { "data": { "text/plain": [ "19.775249709324303" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "out.outputs['se_2022_mtr.txt'].mtrpc.mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The optional parameter `addons` that we passed to the run command is a ```list``` of EUROMOD Addons to be integrated in the spine . Each item of the ``list`` is a ```tuple``` with two ```str``` objects. The first ```str``` is the name of the Addon and the second `str` is the name of the system in the Addon to be integrated (typically, it is the name of the Addon ```_``` two-letter country code, e.g. LMA_AT). The default valuye here is []. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run with extensions\n", "Run the simulation for the Swedish system SE_2022 switching on the Benefit Take-up Adjustment extension 'BTA'." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:37:03.975400Z", "iopub.status.busy": "2026-01-13T11:37:03.967180Z", "iopub.status.idle": "2026-01-13T11:37:06.990926Z", "shell.execute_reply": "2026-01-13T11:37:06.990926Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Simulation for system SE_2022 with dataset SE_2022_b1 finished.\n" ] }, { "data": { "text/plain": [ "------------------------------\n", "Simulation\n", "------------------------------\n", "\t constantsToOverwrite: {}\n", "\t errors: []\n", "\t output_filenames: ['se_2022_base_mtr.txt', 'se_2022_mtr.txt']\n", "\t outputs: Pandas DataFrame of 251 variables and 20448 observations., Pandas DataFrame of 38 variables and 20448 observations." ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "out_BTA =mod['SE']['SE_2022'].run(data,\"SE_2022_b1\",switches=[(\"BTA\",True)])\n", "out" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2026-01-13T11:37:06.990926Z", "iopub.status.busy": "2026-01-13T11:37:06.990926Z", "iopub.status.idle": "2026-01-13T11:37:07.062272Z", "shell.execute_reply": "2026-01-13T11:37:07.062272Z" } }, "outputs": [ { "data": { "text/plain": [ "169.6445978333495" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "out_BTA.outputs[0].ils_ben.mean() - outputdata_baseline.ils_ben.mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The optional parameter `switches` must define a `list` of the [EUROMOD](https://euromod-web.jrc.ec.europa.eu \"https://euromod-web.jrc.ec.europa.eu\") extensions to be switched on or off in the simulation. Each item in the ``list`` is a ```tuple``` with two objects. The first object is a ```str``` short name of the Extension. The second object is a ```boolean```. The default is []. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "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.12.3" } }, "nbformat": 4, "nbformat_minor": 4 }