From c9c264f0fb80ef9fc52f4e30d7b95b17dcb008ff Mon Sep 17 00:00:00 2001 From: elpamart Date: Fri, 29 Sep 2023 09:23:11 +0200 Subject: [PATCH] fix enl namming --- ...s_in_stored_procedures_LG_v2_0_09_23.ipynb | 245 +----------------- 1 file changed, 5 insertions(+), 240 deletions(-) diff --git a/data/notebooks/Lab/Updates_in_stored_procedures_LG_v2_0_09_23.ipynb b/data/notebooks/Lab/Updates_in_stored_procedures_LG_v2_0_09_23.ipynb index 65e091be95..93e3942ede 100644 --- a/data/notebooks/Lab/Updates_in_stored_procedures_LG_v2_0_09_23.ipynb +++ b/data/notebooks/Lab/Updates_in_stored_procedures_LG_v2_0_09_23.ipynb @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 1, "id": "ec6f1dba", "metadata": {}, "outputs": [], @@ -94,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 2, "id": "a1fcf162", "metadata": {}, "outputs": [], @@ -129,7 +129,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 3, "id": "bc136206", "metadata": {}, "outputs": [], @@ -145,7 +145,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "id": "1f72adc5", "metadata": {}, "outputs": [], @@ -363,241 +363,6 @@ "\"\"\"" ] }, - { - "cell_type": "code", - "execution_count": 10, - "id": "0235fafe", - "metadata": {}, - "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", - "
idnameshortNamenameCodedescriptionstatusmetadataunitId
0936d0a9f-fe48-42b4-9433-63282d4dada5Deforestation footprint (sLUC)Deforestation footprint (sLUC)DF_SLUCThe deforestation footprint (sLUC) indicator q...active{'name': 'Deforestation footprint (sLUC)', 'un...6970f9b8-eba0-4fee-b6ee-2723ce6604d4
1157b5f22-916b-4981-84c7-f6607ec65445GHG emissions from deforestation (sLUC)GHGs (deforestation, sLUC)GHG_DEF_SLUCThe GHG emissions from deforestation (sLUC) in...active{'name': 'GHG emissions from deforestation (sL...a0e8110c-fbde-4c8c-ac19-f0f69078b96b
23a718205-10c1-4e11-81b3-cb8965e378c7Biodiversity importance of natural ecosystems ...Forest landscape integrity lossFLILThe biodiversity importance of natural ecosyst...active{'name': 'Biodiversity importance of natural e...1129394b-6baa-41dd-9409-80d808dbc32e
39c2124c7-5df0-40d5-962e-d35480d48cd3Surface or groundwater useWater useWUThe surface or groundwater use indicator estim...active{'name': 'Surface or groundwater use', 'units'...9c0da38a-6371-4c79-879b-218fc39c4700
4ffdd6f19-6737-4a10-9d36-5243d3f14b45Excess surface or groundwater useUnsustainable water useUWUThe excess surface or groundwater use indicato...active{'name': 'Excess surface or groundwater use', ...9c0da38a-6371-4c79-879b-218fc39c4700
55c595ac7-f144-485f-9f32-601f6faae9feLand use footprint for productionLand footprintLFThe land use footprint for production indicato...active{'name': 'Land use footprint for production', ...6970f9b8-eba0-4fee-b6ee-2723ce6604d4
61994e7bf-5442-4061-ba48-6320574263adGHG emissions from farm managementGHGs (farm management)GHG_FARMThe GHG emissions from farm management indicat...active{'name': 'GHG emissions from farm management',...a0e8110c-fbde-4c8c-ac19-f0f69078b96b
7d5f945c9-8636-45a2-a7c9-67a1dc8e687aFreshwater nutrient load assimilation volumeNutrient loadNLThe freshwater nutrient load assimilation volu...active{'name': 'Freshwater nutrient load assimilatio...9c0da38a-6371-4c79-879b-218fc39c4700
8a39394be-ad57-41bc-9c2c-be0949ec6193Excess freshwater nutrient load assimilation v...Excess nutrient loadENLThe excess freshwater nutrient load assimilati...active{'name': 'Excess freshwater nutrient load assi...9c0da38a-6371-4c79-879b-218fc39c4700
95c133ba4-da24-46db-9c6c-ece7520f01b0Cropland expansion in natural ecosystemsNet cropland expansionNCEThe annual average area of cropland expansion ...active{'name': 'Cropland expansion in natural ecosys...6970f9b8-eba0-4fee-b6ee-2723ce6604d4
\n", - "
" - ], - "text/plain": [ - " id \\\n", - "0 936d0a9f-fe48-42b4-9433-63282d4dada5 \n", - "1 157b5f22-916b-4981-84c7-f6607ec65445 \n", - "2 3a718205-10c1-4e11-81b3-cb8965e378c7 \n", - "3 9c2124c7-5df0-40d5-962e-d35480d48cd3 \n", - "4 ffdd6f19-6737-4a10-9d36-5243d3f14b45 \n", - "5 5c595ac7-f144-485f-9f32-601f6faae9fe \n", - "6 1994e7bf-5442-4061-ba48-6320574263ad \n", - "7 d5f945c9-8636-45a2-a7c9-67a1dc8e687a \n", - "8 a39394be-ad57-41bc-9c2c-be0949ec6193 \n", - "9 5c133ba4-da24-46db-9c6c-ece7520f01b0 \n", - "\n", - " name \\\n", - "0 Deforestation footprint (sLUC) \n", - "1 GHG emissions from deforestation (sLUC) \n", - "2 Biodiversity importance of natural ecosystems ... \n", - "3 Surface or groundwater use \n", - "4 Excess surface or groundwater use \n", - "5 Land use footprint for production \n", - "6 GHG emissions from farm management \n", - "7 Freshwater nutrient load assimilation volume \n", - "8 Excess freshwater nutrient load assimilation v... \n", - "9 Cropland expansion in natural ecosystems \n", - "\n", - " shortName nameCode \\\n", - "0 Deforestation footprint (sLUC) DF_SLUC \n", - "1 GHGs (deforestation, sLUC) GHG_DEF_SLUC \n", - "2 Forest landscape integrity loss FLIL \n", - "3 Water use WU \n", - "4 Unsustainable water use UWU \n", - "5 Land footprint LF \n", - "6 GHGs (farm management) GHG_FARM \n", - "7 Nutrient load NL \n", - "8 Excess nutrient load ENL \n", - "9 Net cropland expansion NCE \n", - "\n", - " description status \\\n", - "0 The deforestation footprint (sLUC) indicator q... active \n", - "1 The GHG emissions from deforestation (sLUC) in... active \n", - "2 The biodiversity importance of natural ecosyst... active \n", - "3 The surface or groundwater use indicator estim... active \n", - "4 The excess surface or groundwater use indicato... active \n", - "5 The land use footprint for production indicato... active \n", - "6 The GHG emissions from farm management indicat... active \n", - "7 The freshwater nutrient load assimilation volu... active \n", - "8 The excess freshwater nutrient load assimilati... active \n", - "9 The annual average area of cropland expansion ... active \n", - "\n", - " metadata \\\n", - "0 {'name': 'Deforestation footprint (sLUC)', 'un... \n", - "1 {'name': 'GHG emissions from deforestation (sL... \n", - "2 {'name': 'Biodiversity importance of natural e... \n", - "3 {'name': 'Surface or groundwater use', 'units'... \n", - "4 {'name': 'Excess surface or groundwater use', ... \n", - "5 {'name': 'Land use footprint for production', ... \n", - "6 {'name': 'GHG emissions from farm management',... \n", - "7 {'name': 'Freshwater nutrient load assimilatio... \n", - "8 {'name': 'Excess freshwater nutrient load assi... \n", - "9 {'name': 'Cropland expansion in natural ecosys... \n", - "\n", - " unitId \n", - "0 6970f9b8-eba0-4fee-b6ee-2723ce6604d4 \n", - "1 a0e8110c-fbde-4c8c-ac19-f0f69078b96b \n", - "2 1129394b-6baa-41dd-9409-80d808dbc32e \n", - "3 9c0da38a-6371-4c79-879b-218fc39c4700 \n", - "4 9c0da38a-6371-4c79-879b-218fc39c4700 \n", - "5 6970f9b8-eba0-4fee-b6ee-2723ce6604d4 \n", - "6 a0e8110c-fbde-4c8c-ac19-f0f69078b96b \n", - "7 9c0da38a-6371-4c79-879b-218fc39c4700 \n", - "8 9c0da38a-6371-4c79-879b-218fc39c4700 \n", - "9 6970f9b8-eba0-4fee-b6ee-2723ce6604d4 " - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pd.read_sql_query(\"\"\"SELECT * FROM indicator\"\"\", conn)" - ] - }, { "cell_type": "code", "execution_count": 6, @@ -1157,7 +922,7 @@ "# 1. Obtain the weighted percentage of excess of nutrient load by the commodity production\n", "# 2. Multiply the weighted excess of water withdrawals by the total nutrient load indicator\n", "sourcing_records[\"nutrient_load_reduction\"] = (\n", - " sourcing_records[\"raw_nlr_per_tonne_annual\"] * sourcing_records[\"nutrient_load\"]\n", + " sourcing_records[\"raw_enl_per_tonne_annual\"] * sourcing_records[\"nutrient_load\"]\n", ") / (100 * sourcing_records[\"production\"])\n", "\n", "sourcing_records.head()"