{"id":20033232,"url":"https://github.com/benportner/ecoinvent_electricity_comparison","last_synced_at":"2026-02-08T08:32:41.952Z","repository":{"id":135280587,"uuid":"203571455","full_name":"BenPortner/ecoinvent_electricity_comparison","owner":"BenPortner","description":"What is the most sustainable way to generate electricity? A comparison of ecoinvent datasets.","archived":false,"fork":false,"pushed_at":"2019-08-21T16:31:20.000Z","size":935,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T18:15:54.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenPortner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-21T11:37:20.000Z","updated_at":"2019-08-22T11:33:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb5c6bab-19f6-4bb0-821d-178e926da611","html_url":"https://github.com/BenPortner/ecoinvent_electricity_comparison","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"1d0f1b387a1450d953efea1b2beebb6771f54055"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPortner%2Fecoinvent_electricity_comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPortner%2Fecoinvent_electricity_comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPortner%2Fecoinvent_electricity_comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPortner%2Fecoinvent_electricity_comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenPortner","download_url":"https://codeload.github.com/BenPortner/ecoinvent_electricity_comparison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241465080,"owners_count":19967243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T09:45:17.612Z","updated_at":"2026-02-08T08:32:41.903Z","avatar_url":"https://github.com/BenPortner.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"For a properly rendered version of the notebook, click here:https://nbviewer.jupyter.org/github/BenPortner/ecoinvent_electricity_comparison/blob/master/notebook.html\n\n# What is the most sustainable way to generate electricity? A comparison of ecoinvent datasets.\n\n\u003ch1\u003eTable of Contents\u003cspan class=\"tocSkip\"\u003e\u003c/span\u003e\u003c/h1\u003e\n\u003cdiv class=\"toc\"\u003e\u003cul class=\"toc-item\"\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Introduction\" data-toc-modified-id=\"Introduction-1\"\u003e\u003cspan class=\"toc-item-num\"\u003e1\u0026nbsp;\u0026nbsp;\u003c/span\u003eIntroduction\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Calculation\" data-toc-modified-id=\"Calculation-2\"\u003e\u003cspan class=\"toc-item-num\"\u003e2\u0026nbsp;\u0026nbsp;\u003c/span\u003eCalculation\u003c/a\u003e\u003c/span\u003e\u003cul class=\"toc-item\"\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#ILCD-scores\" data-toc-modified-id=\"ILCD-scores-2.1\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.1\u0026nbsp;\u0026nbsp;\u003c/span\u003eILCD scores\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Sustainability-Index\" data-toc-modified-id=\"Sustainability-Index-2.2\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.2\u0026nbsp;\u0026nbsp;\u003c/span\u003eSustainability Index\u003c/a\u003e\u003c/span\u003e\u003cul class=\"toc-item\"\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Normalization\" data-toc-modified-id=\"Normalization-2.2.1\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.2.1\u0026nbsp;\u0026nbsp;\u003c/span\u003eNormalization\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Weighing-and-aggregation\" data-toc-modified-id=\"Weighing-and-aggregation-2.2.2\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.2.2\u0026nbsp;\u0026nbsp;\u003c/span\u003eWeighing and aggregation\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Export\" data-toc-modified-id=\"Export-2.3\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.3\u0026nbsp;\u0026nbsp;\u003c/span\u003eExport\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Visualization\" data-toc-modified-id=\"Visualization-2.4\"\u003e\u003cspan class=\"toc-item-num\"\u003e2.4\u0026nbsp;\u0026nbsp;\u003c/span\u003eVisualization\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003e\u003ca href=\"#Discussion\" data-toc-modified-id=\"Discussion-3\"\u003e\u003cspan class=\"toc-item-num\"\u003e3\u0026nbsp;\u0026nbsp;\u003c/span\u003eDiscussion\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\n\n## Introduction\n\nWhich electricity generation technology is the most sustainable one? Is it photovoltaic panels on house roofs? Is it off-shore wind parks? Is it nuclear pressure water reactors?! The answer will depend on several aspects. \n\nFirst of all, it depends on the models used to describe the different generation technologies. Here, I will use models and parameters as supplied by ecoinvent 3.5, allocation at the point of substitution system model (https://www.ecoinvent.org/).\n\nSecondly, it will depend on how we define sustainability. For example, wind energy seems very sustainable from a climate change point of view (low green house gas emissions). However, wind turbines need large amounts of minerals and metals in their construction, making them seem less sustainable from a resource point of view. This is one example of how different indicators will yield different answers. For this study, I will use the 19 midpoint indicators recommended by the International Reference Life Cycle Data System, version 2.0, as implemented in ecoinvent 3.5. I will present results for each indicator. Additionally, I will present normalized, equal-weighted aggregates. The later is just *one* example of how to aggregate multiple indicators to yield one sustainability index. There are infinitely many ways to aggregate different indicators and none of them is preferable over the other. In the end, sustainability measures will always be a subjective construct because different stakeholders give different emphasis to different impact categories.\n\n## Calculation\n\n### ILCD scores\nI use the brightway2 package for python for impact calculations (https://brightwaylca.org/). Brightway allows to \n- read the database (ecoinvent 3.5 APOS)\n- query the database for activities (all electricity production activities in the database)\n- calculate the impact score of activities according to different methods (ILCD 2.0)\n\nFirst, imports.\n\n\n```python\nimport brightway2 as bw\nimport pandas as pd\nimport xlsxwriter\n```\n\nI'll skip the setup here. Please refer to the official brightway guide for details on how to import the ecoinvent 3.5 database etc.: https://nbviewer.jupyter.org/urls/bitbucket.org/cmutel/brightway2/raw/default/notebooks/Getting%20Started%20with%20Brightway2.ipynb\n\nLet's start by getting all electricity production activities in the database.\n\n\n```python\n# setting the directory containing ecoinvent 3.5 APOS database\nbw.projects.set_current(\"ecoinvent-import\")\n\n# querying \nlActivities = [a for a in bw.Database(\"ecoinvent 3.5 APOS\") if \"electricity production\" in a[\"name\"]]\n\nlen(lActivities)\n```\n\n\n\n\n    1488\n\n\n\necoinvent knows 1,488 different activities that produce electricity! Let's go ahead and calculate their impacts. \n\n**Note: Computation of all values may take up to an hour! I reduced the number of activities to the first 5 in the list to make the notebook runable. Feel free to delete the corresponding line to calculate all impacts on your system.**\n\n\n```python\n###### delete line below to calculate ALL impacts ######\nlActivities = lActivities[:5]\n########################################################\n\n# get ILCD 2.0 midpoint methods\nilcd = [m for m in bw.methods if \"ILCD\" in str(m) and \"2018\" in str(m) and \"LT\" not in str(m)]\n\n# compute all ILCD scores for all activities\nldScores = []\nfor a in lActivities:\n    oLCA = bw.LCA({a:1}, ilcd[0])\n    oLCA.lci()\n    oLCA.lcia()\n    dScores = {ilcd[0]:oLCA.score}\n    for oMethod in ilcd[1:]:\n        oLCA.switch_method(oMethod)\n        oLCA.lcia()\n        dScores[oMethod] = oLCA.score\n    ldScores.append(dScores)\n    \n# convert to dataframe\ndf = pd.DataFrame(ldScores)\ndf.head()\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change biogenic)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change fossil)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change land use and land use change)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change total)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater and terrestrial acidification)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater ecotoxicity)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, marine eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, terrestrial eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ionising radiation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, non-carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ozone layer depletion)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, photochemical ozone creation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, respiratory effects, inorganics)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, dissipated water)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, fossils)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, land use)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, minerals and metals)\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003e0\u003c/th\u003e\n      \u003ctd\u003e0.000053\u003c/td\u003e\n      \u003ctd\u003e0.588143\u003c/td\u003e\n      \u003ctd\u003e0.000015\u003c/td\u003e\n      \u003ctd\u003e0.588211\u003c/td\u003e\n      \u003ctd\u003e0.000645\u003c/td\u003e\n      \u003ctd\u003e0.217072\u003c/td\u003e\n      \u003ctd\u003e0.000008\u003c/td\u003e\n      \u003ctd\u003e0.000180\u003c/td\u003e\n      \u003ctd\u003e0.001934\u003c/td\u003e\n      \u003ctd\u003e1.142199e-09\u003c/td\u003e\n      \u003ctd\u003e0.001369\u003c/td\u003e\n      \u003ctd\u003e1.202924e-08\u003c/td\u003e\n      \u003ctd\u003e5.099300e-08\u003c/td\u003e\n      \u003ctd\u003e0.000718\u003c/td\u003e\n      \u003ctd\u003e1.659245e-09\u003c/td\u003e\n      \u003ctd\u003e0.044559\u003c/td\u003e\n      \u003ctd\u003e9.281378\u003c/td\u003e\n      \u003ctd\u003e0.170848\u003c/td\u003e\n      \u003ctd\u003e1.040912e-07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e1\u003c/th\u003e\n      \u003ctd\u003e0.000162\u003c/td\u003e\n      \u003ctd\u003e1.053454\u003c/td\u003e\n      \u003ctd\u003e0.000078\u003c/td\u003e\n      \u003ctd\u003e1.053694\u003c/td\u003e\n      \u003ctd\u003e0.010851\u003c/td\u003e\n      \u003ctd\u003e0.074229\u003c/td\u003e\n      \u003ctd\u003e0.000753\u003c/td\u003e\n      \u003ctd\u003e0.001528\u003c/td\u003e\n      \u003ctd\u003e0.015533\u003c/td\u003e\n      \u003ctd\u003e1.561707e-09\u003c/td\u003e\n      \u003ctd\u003e0.004844\u003c/td\u003e\n      \u003ctd\u003e4.135861e-08\u003c/td\u003e\n      \u003ctd\u003e6.808792e-09\u003c/td\u003e\n      \u003ctd\u003e0.004120\u003c/td\u003e\n      \u003ctd\u003e1.342487e-08\u003c/td\u003e\n      \u003ctd\u003e0.077180\u003c/td\u003e\n      \u003ctd\u003e15.350463\u003c/td\u003e\n      \u003ctd\u003e2.357585\u003c/td\u003e\n      \u003ctd\u003e1.142805e-07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e2\u003c/th\u003e\n      \u003ctd\u003e0.000026\u003c/td\u003e\n      \u003ctd\u003e0.012671\u003c/td\u003e\n      \u003ctd\u003e0.000030\u003c/td\u003e\n      \u003ctd\u003e0.012726\u003c/td\u003e\n      \u003ctd\u003e0.000074\u003c/td\u003e\n      \u003ctd\u003e0.025228\u003c/td\u003e\n      \u003ctd\u003e0.000009\u003c/td\u003e\n      \u003ctd\u003e0.000060\u003c/td\u003e\n      \u003ctd\u003e0.000187\u003c/td\u003e\n      \u003ctd\u003e5.676048e-10\u003c/td\u003e\n      \u003ctd\u003e1.184924\u003c/td\u003e\n      \u003ctd\u003e3.716515e-09\u003c/td\u003e\n      \u003ctd\u003e5.734082e-08\u003c/td\u003e\n      \u003ctd\u003e0.000051\u003c/td\u003e\n      \u003ctd\u003e2.871032e-09\u003c/td\u003e\n      \u003ctd\u003e0.132819\u003c/td\u003e\n      \u003ctd\u003e14.255169\u003c/td\u003e\n      \u003ctd\u003e0.084286\u003c/td\u003e\n      \u003ctd\u003e5.122173e-08\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003ctd\u003e0.000363\u003c/td\u003e\n      \u003ctd\u003e0.077957\u003c/td\u003e\n      \u003ctd\u003e0.000177\u003c/td\u003e\n      \u003ctd\u003e0.078496\u003c/td\u003e\n      \u003ctd\u003e0.000570\u003c/td\u003e\n      \u003ctd\u003e0.089036\u003c/td\u003e\n      \u003ctd\u003e0.000072\u003c/td\u003e\n      \u003ctd\u003e0.000101\u003c/td\u003e\n      \u003ctd\u003e0.000926\u003c/td\u003e\n      \u003ctd\u003e2.191182e-09\u003c/td\u003e\n      \u003ctd\u003e0.009163\u003c/td\u003e\n      \u003ctd\u003e2.707840e-08\u003c/td\u003e\n      \u003ctd\u003e8.781046e-09\u003c/td\u003e\n      \u003ctd\u003e0.000315\u003c/td\u003e\n      \u003ctd\u003e4.861033e-09\u003c/td\u003e\n      \u003ctd\u003e0.112100\u003c/td\u003e\n      \u003ctd\u003e1.200793\u003c/td\u003e\n      \u003ctd\u003e0.592213\u003c/td\u003e\n      \u003ctd\u003e3.434466e-06\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003ctd\u003e0.000287\u003c/td\u003e\n      \u003ctd\u003e0.061599\u003c/td\u003e\n      \u003ctd\u003e0.000140\u003c/td\u003e\n      \u003ctd\u003e0.062025\u003c/td\u003e\n      \u003ctd\u003e0.000450\u003c/td\u003e\n      \u003ctd\u003e0.070353\u003c/td\u003e\n      \u003ctd\u003e0.000057\u003c/td\u003e\n      \u003ctd\u003e0.000080\u003c/td\u003e\n      \u003ctd\u003e0.000732\u003c/td\u003e\n      \u003ctd\u003e1.731384e-09\u003c/td\u003e\n      \u003ctd\u003e0.007240\u003c/td\u003e\n      \u003ctd\u003e2.139614e-08\u003c/td\u003e\n      \u003ctd\u003e6.938799e-09\u003c/td\u003e\n      \u003ctd\u003e0.000249\u003c/td\u003e\n      \u003ctd\u003e3.841037e-09\u003c/td\u003e\n      \u003ctd\u003e0.088576\u003c/td\u003e\n      \u003ctd\u003e0.948821\u003c/td\u003e\n      \u003ctd\u003e0.467936\u003c/td\u003e\n      \u003ctd\u003e2.713751e-06\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\nNumbered indices are not very readable. Let's use metadata about the activities as the index instead:\n\n\n```python\n# get names\nnames = [a[\"name\"].split(\",\") for a in lActivities]\ndf_names = pd.DataFrame(names).fillna(\" \")\n# split names at the commas to make reading and manipulation easier\ncol_names = [(\"name_\"+str(c), \" \", \" \") for c in df_names.columns]\ndf[col_names] = df_names\n\n# add units and locations\ndf[(\"unit\",\" \",\" \")] = [a[\"unit\"] for a in lActivities]\ndf[(\"location\",\" \",\" \")] = [a[\"location\"] for a in lActivities]\n\n# set index\nmeta_data_cols = col_names + [(\"unit\", \" \", \" \"), (\"location\", \" \", \" \")]\ndf.set_index(meta_data_cols, inplace=True)\n\ndf.head()\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change biogenic)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change fossil)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change land use and land use change)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change total)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater and terrestrial acidification)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater ecotoxicity)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, marine eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, terrestrial eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ionising radiation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, non-carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ozone layer depletion)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, photochemical ozone creation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, respiratory effects, inorganics)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, dissipated water)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, fossils)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, land use)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, minerals and metals)\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e(name_0,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_1,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_2,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_3,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_4,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_5,  ,  )\u003c/th\u003e\n      \u003cth\u003e(unit,  ,  )\u003c/th\u003e\n      \u003cth\u003e(location,  ,  )\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"5\" valign=\"top\"\u003eelectricity production\u003c/th\u003e\n      \u003cth\u003enatural gas\u003c/th\u003e\n      \u003cth\u003econventional power plant\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eCN-JS\u003c/th\u003e\n      \u003ctd\u003e0.000053\u003c/td\u003e\n      \u003ctd\u003e0.588143\u003c/td\u003e\n      \u003ctd\u003e0.000015\u003c/td\u003e\n      \u003ctd\u003e0.588211\u003c/td\u003e\n      \u003ctd\u003e0.000645\u003c/td\u003e\n      \u003ctd\u003e0.217072\u003c/td\u003e\n      \u003ctd\u003e0.000008\u003c/td\u003e\n      \u003ctd\u003e0.000180\u003c/td\u003e\n      \u003ctd\u003e0.001934\u003c/td\u003e\n      \u003ctd\u003e1.142199e-09\u003c/td\u003e\n      \u003ctd\u003e0.001369\u003c/td\u003e\n      \u003ctd\u003e1.202924e-08\u003c/td\u003e\n      \u003ctd\u003e5.099300e-08\u003c/td\u003e\n      \u003ctd\u003e0.000718\u003c/td\u003e\n      \u003ctd\u003e1.659245e-09\u003c/td\u003e\n      \u003ctd\u003e0.044559\u003c/td\u003e\n      \u003ctd\u003e9.281378\u003c/td\u003e\n      \u003ctd\u003e0.170848\u003c/td\u003e\n      \u003ctd\u003e1.040912e-07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ehard coal\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eRoW\u003c/th\u003e\n      \u003ctd\u003e0.000162\u003c/td\u003e\n      \u003ctd\u003e1.053454\u003c/td\u003e\n      \u003ctd\u003e0.000078\u003c/td\u003e\n      \u003ctd\u003e1.053694\u003c/td\u003e\n      \u003ctd\u003e0.010851\u003c/td\u003e\n      \u003ctd\u003e0.074229\u003c/td\u003e\n      \u003ctd\u003e0.000753\u003c/td\u003e\n      \u003ctd\u003e0.001528\u003c/td\u003e\n      \u003ctd\u003e0.015533\u003c/td\u003e\n      \u003ctd\u003e1.561707e-09\u003c/td\u003e\n      \u003ctd\u003e0.004844\u003c/td\u003e\n      \u003ctd\u003e4.135861e-08\u003c/td\u003e\n      \u003ctd\u003e6.808792e-09\u003c/td\u003e\n      \u003ctd\u003e0.004120\u003c/td\u003e\n      \u003ctd\u003e1.342487e-08\u003c/td\u003e\n      \u003ctd\u003e0.077180\u003c/td\u003e\n      \u003ctd\u003e15.350463\u003c/td\u003e\n      \u003ctd\u003e2.357585\u003c/td\u003e\n      \u003ctd\u003e1.142805e-07\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003enuclear\u003c/th\u003e\n      \u003cth\u003eboiling water reactor\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eUS-NPCC\u003c/th\u003e\n      \u003ctd\u003e0.000026\u003c/td\u003e\n      \u003ctd\u003e0.012671\u003c/td\u003e\n      \u003ctd\u003e0.000030\u003c/td\u003e\n      \u003ctd\u003e0.012726\u003c/td\u003e\n      \u003ctd\u003e0.000074\u003c/td\u003e\n      \u003ctd\u003e0.025228\u003c/td\u003e\n      \u003ctd\u003e0.000009\u003c/td\u003e\n      \u003ctd\u003e0.000060\u003c/td\u003e\n      \u003ctd\u003e0.000187\u003c/td\u003e\n      \u003ctd\u003e5.676048e-10\u003c/td\u003e\n      \u003ctd\u003e1.184924\u003c/td\u003e\n      \u003ctd\u003e3.716515e-09\u003c/td\u003e\n      \u003ctd\u003e5.734082e-08\u003c/td\u003e\n      \u003ctd\u003e0.000051\u003c/td\u003e\n      \u003ctd\u003e2.871032e-09\u003c/td\u003e\n      \u003ctd\u003e0.132819\u003c/td\u003e\n      \u003ctd\u003e14.255169\u003c/td\u003e\n      \u003ctd\u003e0.084286\u003c/td\u003e\n      \u003ctd\u003e5.122173e-08\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ephotovoltaic\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003e3kWp slanted-roof installation\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emulti-Si\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003epanel\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emounted\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eLV\u003c/th\u003e\n      \u003ctd\u003e0.000363\u003c/td\u003e\n      \u003ctd\u003e0.077957\u003c/td\u003e\n      \u003ctd\u003e0.000177\u003c/td\u003e\n      \u003ctd\u003e0.078496\u003c/td\u003e\n      \u003ctd\u003e0.000570\u003c/td\u003e\n      \u003ctd\u003e0.089036\u003c/td\u003e\n      \u003ctd\u003e0.000072\u003c/td\u003e\n      \u003ctd\u003e0.000101\u003c/td\u003e\n      \u003ctd\u003e0.000926\u003c/td\u003e\n      \u003ctd\u003e2.191182e-09\u003c/td\u003e\n      \u003ctd\u003e0.009163\u003c/td\u003e\n      \u003ctd\u003e2.707840e-08\u003c/td\u003e\n      \u003ctd\u003e8.781046e-09\u003c/td\u003e\n      \u003ctd\u003e0.000315\u003c/td\u003e\n      \u003ctd\u003e4.861033e-09\u003c/td\u003e\n      \u003ctd\u003e0.112100\u003c/td\u003e\n      \u003ctd\u003e1.200793\u003c/td\u003e\n      \u003ctd\u003e0.592213\u003c/td\u003e\n      \u003ctd\u003e3.434466e-06\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eIN-JH\u003c/th\u003e\n      \u003ctd\u003e0.000287\u003c/td\u003e\n      \u003ctd\u003e0.061599\u003c/td\u003e\n      \u003ctd\u003e0.000140\u003c/td\u003e\n      \u003ctd\u003e0.062025\u003c/td\u003e\n      \u003ctd\u003e0.000450\u003c/td\u003e\n      \u003ctd\u003e0.070353\u003c/td\u003e\n      \u003ctd\u003e0.000057\u003c/td\u003e\n      \u003ctd\u003e0.000080\u003c/td\u003e\n      \u003ctd\u003e0.000732\u003c/td\u003e\n      \u003ctd\u003e1.731384e-09\u003c/td\u003e\n      \u003ctd\u003e0.007240\u003c/td\u003e\n      \u003ctd\u003e2.139614e-08\u003c/td\u003e\n      \u003ctd\u003e6.938799e-09\u003c/td\u003e\n      \u003ctd\u003e0.000249\u003c/td\u003e\n      \u003ctd\u003e3.841037e-09\u003c/td\u003e\n      \u003ctd\u003e0.088576\u003c/td\u003e\n      \u003ctd\u003e0.948821\u003c/td\u003e\n      \u003ctd\u003e0.467936\u003c/td\u003e\n      \u003ctd\u003e2.713751e-06\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\nThat's it! These are impact scores for all electricity production activities in ecoinvent 3.5. I can use these to answer indicator-specific questions like: Which electricity generation technology has the lowest total global warming potential (GWP 100)?\n\n\n```python\ndf[(\"ILCD 2.0 2018 midpoint\", \"climate change\", \"climate change total\")].idxmin()\n```\n\n\n\n\n    ('electricity production',\n     ' nuclear',\n     ' boiling water reactor',\n     ' ',\n     ' ',\n     ' ',\n     'kilowatt hour',\n     'US-NPCC')\n\n\n\nOr statistical evaluations, like what is the average and standard deviation for the GWP 100 indicator for all electricity generation activities?\n\n\n```python\ndf[(\"ILCD 2.0 2018 midpoint\", \"climate change\", \"climate change total\")].describe()\n```\n\n\n\n\n    count    5.000000\n    mean     0.359031\n    std      0.453299\n    min      0.012726\n    25%      0.062025\n    50%      0.078496\n    75%      0.588211\n    max      1.053694\n    Name: (ILCD 2.0 2018 midpoint, climate change, climate change total), dtype: float64\n\n\n\n### Sustainability Index\n\nUsing the produced data we can rank the electricity generation datasets according to individual impact indicators. However, a single indicator does not give enough information to decide if a technology is sustainable or not. To get a bigger picture, I want to aggregate all indicators into one number. As mentioned in the introduction, there are infinitely many ways to do this. The one chosen here is not more right or wrong than any other way. Feel free to change this part according to your needs!\n\n#### Normalization\n\nFor each indicator, I choose the minimum and the maximum value over all activities. I define the minimum as 0 and the maximum as 1. Then I use linear interpolation to project all other values into this [0, 1] range.\n\n\n```python\ndf_normalized = df.copy()\nfor indicator in df.columns:\n    max_value = df[indicator].max()\n    min_value = df[indicator].min()\n    df_normalized[indicator] = (df[indicator] - min_value) / (max_value - min_value)\n    \ndf_normalized.head()\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change biogenic)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change fossil)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change land use and land use change)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change total)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater and terrestrial acidification)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater ecotoxicity)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, marine eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, terrestrial eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ionising radiation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, non-carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ozone layer depletion)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, photochemical ozone creation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, respiratory effects, inorganics)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, dissipated water)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, fossils)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, land use)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, minerals and metals)\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e(name_0,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_1,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_2,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_3,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_4,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_5,  ,  )\u003c/th\u003e\n      \u003cth\u003e(unit,  ,  )\u003c/th\u003e\n      \u003cth\u003e(location,  ,  )\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"5\" valign=\"top\"\u003eelectricity production\u003c/th\u003e\n      \u003cth\u003enatural gas\u003c/th\u003e\n      \u003cth\u003econventional power plant\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eCN-JS\u003c/th\u003e\n      \u003ctd\u003e0.079120\u003c/td\u003e\n      \u003ctd\u003e0.552922\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.552836\u003c/td\u003e\n      \u003ctd\u003e0.052945\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.081488\u003c/td\u003e\n      \u003ctd\u003e0.113848\u003c/td\u003e\n      \u003ctd\u003e0.353906\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.220836\u003c/td\u003e\n      \u003ctd\u003e0.874380\u003c/td\u003e\n      \u003ctd\u003e0.163834\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.578584\u003c/td\u003e\n      \u003ctd\u003e0.038077\u003c/td\u003e\n      \u003ctd\u003e0.015627\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ehard coal\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eRoW\u003c/th\u003e\n      \u003ctd\u003e0.402550\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.388987\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.255419\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.612291\u003c/td\u003e\n      \u003ctd\u003e0.002936\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.369608\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.018639\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003enuclear\u003c/th\u003e\n      \u003cth\u003eboiling water reactor\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eUS-NPCC\u003c/th\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.087117\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.001290\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.102994\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.923947\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ephotovoltaic\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003e3kWp slanted-roof installation\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emulti-Si\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003epanel\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emounted\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eLV\u003c/th\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.062728\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.063182\u003c/td\u003e\n      \u003ctd\u003e0.045976\u003c/td\u003e\n      \u003ctd\u003e0.332602\u003c/td\u003e\n      \u003ctd\u003e0.086409\u003c/td\u003e\n      \u003ctd\u003e0.027954\u003c/td\u003e\n      \u003ctd\u003e0.048144\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.006586\u003c/td\u003e\n      \u003ctd\u003e0.620632\u003c/td\u003e\n      \u003ctd\u003e0.039030\u003c/td\u003e\n      \u003ctd\u003e0.064746\u003c/td\u003e\n      \u003ctd\u003e0.272131\u003c/td\u003e\n      \u003ctd\u003e0.765254\u003c/td\u003e\n      \u003ctd\u003e0.017496\u003c/td\u003e\n      \u003ctd\u003e0.223432\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eIN-JH\u003c/th\u003e\n      \u003ctd\u003e0.773791\u003c/td\u003e\n      \u003ctd\u003e0.047011\u003c/td\u003e\n      \u003ctd\u003e0.770071\u003c/td\u003e\n      \u003ctd\u003e0.047359\u003c/td\u003e\n      \u003ctd\u003e0.034886\u003c/td\u003e\n      \u003ctd\u003e0.235214\u003c/td\u003e\n      \u003ctd\u003e0.066049\u003c/td\u003e\n      \u003ctd\u003e0.013513\u003c/td\u003e\n      \u003ctd\u003e0.035482\u003c/td\u003e\n      \u003ctd\u003e0.716799\u003c/td\u003e\n      \u003ctd\u003e0.004961\u003c/td\u003e\n      \u003ctd\u003e0.469677\u003c/td\u003e\n      \u003ctd\u003e0.002573\u003c/td\u003e\n      \u003ctd\u003e0.048516\u003c/td\u003e\n      \u003ctd\u003e0.185438\u003c/td\u003e\n      \u003ctd\u003e0.498725\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.168763\u003c/td\u003e\n      \u003ctd\u003e0.786975\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\nThe result is a table where all impact scores range between zero and one. Zero means lowest impact with reference to the benchmark (i.e. all ecoinvent 3.5 electricity generation activities). One means highest impact with reference to the benchmark.\n\n#### Weighing and aggregation\n\nWe still have 19 numbers, each of which describes a small part of the big picture \"sustainability\". I will now boil them down to one number by simply adding them up. I call the resulting number \"sustainability index\". Let me stress this again: This index is not more right or wrong than any other one. It is *one* rather arbitrary way to aggregate the individual impact scores.\n\nThe lowest possible number for our index is zero. Zero indicates a technology which achieves the *lowest* possible (with reference to the benchmark) impact score in all nineteen impact categories. The highest possible index value is nineteen. It indicates a technology which has the *highest* possible (with reference to the benchmark) impact score in all nineteen impact categories.\n\nLet's see how the ecoinvent activities score in this index:\n\n\n```python\n# sum\ndf_normalized[(\"SUM\",\" \",\" \")] = df_normalized.sum(axis=1)\n\n# sort ascending\ndf_normalized.sort_values(by=(\"SUM\",\" \",\" \"), ascending=True, inplace=True)\n\ndf_normalized.head()\n```\n\n\n\n\n\u003cdiv\u003e\n\u003cstyle scoped\u003e\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n\u003c/style\u003e\n\u003ctable border=\"1\" class=\"dataframe\"\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change biogenic)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change fossil)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change land use and land use change)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, climate change, climate change total)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater and terrestrial acidification)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater ecotoxicity)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, freshwater eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, marine eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, ecosystem quality, terrestrial eutrophication)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ionising radiation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, non-carcinogenic effects)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, ozone layer depletion)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, photochemical ozone creation)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, human health, respiratory effects, inorganics)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, dissipated water)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, fossils)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, land use)\u003c/th\u003e\n      \u003cth\u003e(ILCD 2.0 2018 midpoint, resources, minerals and metals)\u003c/th\u003e\n      \u003cth\u003e(SUM,  ,  )\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003e(name_0,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_1,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_2,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_3,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_4,  ,  )\u003c/th\u003e\n      \u003cth\u003e(name_5,  ,  )\u003c/th\u003e\n      \u003cth\u003e(unit,  ,  )\u003c/th\u003e\n      \u003cth\u003e(location,  ,  )\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"5\" valign=\"top\"\u003eelectricity production\u003c/th\u003e\n      \u003cth\u003enuclear\u003c/th\u003e\n      \u003cth\u003eboiling water reactor\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eUS-NPCC\u003c/th\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.087117\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.001290\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.102994\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.923947\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e4.115347\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003enatural gas\u003c/th\u003e\n      \u003cth\u003econventional power plant\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eCN-JS\u003c/th\u003e\n      \u003ctd\u003e0.079120\u003c/td\u003e\n      \u003ctd\u003e0.552922\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.552836\u003c/td\u003e\n      \u003ctd\u003e0.052945\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.081488\u003c/td\u003e\n      \u003ctd\u003e0.113848\u003c/td\u003e\n      \u003ctd\u003e0.353906\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.220836\u003c/td\u003e\n      \u003ctd\u003e0.874380\u003c/td\u003e\n      \u003ctd\u003e0.163834\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.578584\u003c/td\u003e\n      \u003ctd\u003e0.038077\u003c/td\u003e\n      \u003ctd\u003e0.015627\u003c/td\u003e\n      \u003ctd\u003e4.678403\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ephotovoltaic\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003e3kWp slanted-roof installation\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emulti-Si\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003epanel\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003emounted\u003c/th\u003e\n      \u003cth rowspan=\"2\" valign=\"top\"\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eIN-JH\u003c/th\u003e\n      \u003ctd\u003e0.773791\u003c/td\u003e\n      \u003ctd\u003e0.047011\u003c/td\u003e\n      \u003ctd\u003e0.770071\u003c/td\u003e\n      \u003ctd\u003e0.047359\u003c/td\u003e\n      \u003ctd\u003e0.034886\u003c/td\u003e\n      \u003ctd\u003e0.235214\u003c/td\u003e\n      \u003ctd\u003e0.066049\u003c/td\u003e\n      \u003ctd\u003e0.013513\u003c/td\u003e\n      \u003ctd\u003e0.035482\u003c/td\u003e\n      \u003ctd\u003e0.716799\u003c/td\u003e\n      \u003ctd\u003e0.004961\u003c/td\u003e\n      \u003ctd\u003e0.469677\u003c/td\u003e\n      \u003ctd\u003e0.002573\u003c/td\u003e\n      \u003ctd\u003e0.048516\u003c/td\u003e\n      \u003ctd\u003e0.185438\u003c/td\u003e\n      \u003ctd\u003e0.498725\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e0.168763\u003c/td\u003e\n      \u003ctd\u003e0.786975\u003c/td\u003e\n      \u003ctd\u003e4.905804\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003eLV\u003c/th\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.062728\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.063182\u003c/td\u003e\n      \u003ctd\u003e0.045976\u003c/td\u003e\n      \u003ctd\u003e0.332602\u003c/td\u003e\n      \u003ctd\u003e0.086409\u003c/td\u003e\n      \u003ctd\u003e0.027954\u003c/td\u003e\n      \u003ctd\u003e0.048144\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.006586\u003c/td\u003e\n      \u003ctd\u003e0.620632\u003c/td\u003e\n      \u003ctd\u003e0.039030\u003c/td\u003e\n      \u003ctd\u003e0.064746\u003c/td\u003e\n      \u003ctd\u003e0.272131\u003c/td\u003e\n      \u003ctd\u003e0.765254\u003c/td\u003e\n      \u003ctd\u003e0.017496\u003c/td\u003e\n      \u003ctd\u003e0.223432\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e6.676299\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ehard coal\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003ekilowatt hour\u003c/th\u003e\n      \u003cth\u003eRoW\u003c/th\u003e\n      \u003ctd\u003e0.402550\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.388987\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.255419\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.612291\u003c/td\u003e\n      \u003ctd\u003e0.002936\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.369608\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e1.000000\u003c/td\u003e\n      \u003ctd\u003e0.018639\u003c/td\u003e\n      \u003ctd\u003e13.050429\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\n\n### Export\n\nLet's export the absolute and the normalized results to an excel file. \n\n\n```python\n# transform index into individual columns for easier manipulation\ndf.reset_index(inplace=True)\ndf_normalized.reset_index(inplace=True)\n\n# make multi-level headers for better readability\ndf.columns = pd.MultiIndex.from_tuples(df.columns)\ndf_normalized.columns = pd.MultiIndex.from_tuples(df_normalized.columns)\n\n# export to xlsx\nwriter = pd.ExcelWriter(\"output/ecoinvent_electricity_comparison.xlsx\", engine='xlsxwriter')\ndf.to_excel(writer, sheet_name='abs')\ndf_normalized.to_excel(writer, sheet_name='norm')\nwriter.save()\n```\n\n### Visualization\n\nLet's draw a heat map showing all normalized impacts for all activities and coloring them according to their magnitude.\n\n\n```python\nimport bokeh.io\nimport bokeh.models\nimport bokeh.plotting\nfrom bokeh.palettes import Reds9\nimport re\nimport numpy as np\n\n# construct list of activity names for display\nnames = df.loc[:,meta_data_cols].apply(lambda x: re.sub(' +', ' ',\" \".join(x[1:])).strip(), axis=1).to_list()\n\n# construct list of method names for display\nmethods = [\", \".join(m[1:]) for m in ilcd]\n\n# define tooltips to be displayed\nTOOLTIPS = [\n    (\"activity\", \"@act\"),\n    (\"impact category\", \"@cat\"),\n    (\"normalized score\", \"@score\"),\n]\n\n# make figure\nf = bokeh.plotting.figure(\n    x_axis_label=\"ILCD 2.0 midpoint indicator\", y_axis_label='ecoinvent activity',\n    plot_width=900, plot_height=800,   \n    tooltips = TOOLTIPS,\n    y_range=bokeh.models.FactorRange(*names),\n    x_range=bokeh.models.FactorRange(*methods)\n)\n\n# define plot data\ndata = {\n    \"score\": [df_normalized.loc[i,m] for i in df_normalized.index for m in ilcd],\n    \"act\": [names[i] for i in df_normalized.index for m in ilcd],\n    \"cat\": [m for i in df_normalized.index for m in methods],\n}\n\n# define colormap\nmapper = bokeh.models.LinearColorMapper(palette=Reds9, low=1, high=0)\n\n# plot\nf.rect(\n    source=data, x=\"cat\", y=\"act\", width=1, height=1,\n    fill_color={'field': 'score', 'transform': mapper},\n    line_color=None,\n)\n\n# rotate x-axis ticks\nf.xaxis.major_label_orientation = np.pi / 4\n    \n# show plot\nbokeh.io.output_notebook()\nbokeh.io.show(f)\n```\n\n\n\n    \u003cdiv class=\"bk-root\"\u003e\n        \u003ca href=\"https://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"\u003e\u003c/a\u003e\n        \u003cspan id=\"1631\"\u003eLoading BokehJS ...\u003c/span\u003e\n    \u003c/div\u003e\n\n\n\n\n\n\n\n\n\n\n\n  \u003cdiv class=\"bk-root\" id=\"8a597481-c264-464b-9e18-ae3bc871afe8\" data-root-id=\"1594\"\u003e\u003c/div\u003e\n\n\n\n\n\nSave the figure to disk.\n\n\n```python\nbokeh.io.output_file(\"output/heatmap.html\")\npath = bokeh.io.save(f)\n```\n\n## Discussion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenportner%2Fecoinvent_electricity_comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenportner%2Fecoinvent_electricity_comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenportner%2Fecoinvent_electricity_comparison/lists"}