Skip to content

Commit

Permalink
Resolve further pandas FutureWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
glatterf42 committed Dec 12, 2024
1 parent b19e920 commit 4a0678f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tutorial/westeros/westeros_historical_new_capacity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"# We will hence start by retrieving the demand in the `firstmodelyear`,\n",
"# and assume this also applies for historic time-periods.\n",
"demand_of_firstmodelyear = float(\n",
" scenario.par(\"demand\", filters={\"year\": scenario.firstmodelyear})[\"value\"]\n",
" scenario.par(\"demand\", filters={\"year\": scenario.firstmodelyear})[\"value\"].iloc[0]\n",
")\n",
"print(f\"The demand of the `firstmodelyear` is {demand_of_firstmodelyear} GWa.\")"
]
Expand All @@ -300,7 +300,7 @@
" \"year_act\": scenario.firstmodelyear,\n",
" \"technology\": \"grid\",\n",
" },\n",
" )[\"value\"]\n",
" )[\"value\"].iloc[0]\n",
")\n",
"print(f\"Grid efficiency is {grid_eff}.\")\n",
"demand_of_firstmodelyear /= grid_eff"
Expand All @@ -313,7 +313,7 @@
"outputs": [],
"source": [
"duration_period = float(\n",
" scenario.par(\"duration_period\", filters={\"year\": history})[\"value\"]\n",
" scenario.par(\"duration_period\", filters={\"year\": history})[\"value\"].iloc[0]\n",
")\n",
"print(f\"The duration of the period is {duration_period} years.\")\n",
"historical_new_capacity = demand_of_firstmodelyear / duration_period"
Expand Down Expand Up @@ -844,12 +844,16 @@
"\n",
"# Retrieve `\"historical_new_capacity\"`\n",
"value = float(\n",
" scenario2.par(\"historical_new_capacity\", filters={\"technology\": \"coal_ppl\"}).value\n",
" scenario2.par(\n",
" \"historical_new_capacity\", filters={\"technology\": \"coal_ppl\"}\n",
" ).value.iloc[0]\n",
")\n",
"\n",
"# Retrieve `\"duration_period\"` for the year 700\n",
"duration_period = float(\n",
" scenario.par(\"duration_period\", filters={\"year\": scenario.firstmodelyear})[\"value\"]\n",
" scenario.par(\"duration_period\", filters={\"year\": scenario.firstmodelyear})[\n",
" \"value\"\n",
" ].iloc[0]\n",
")\n",
"\n",
"value *= duration_period\n",
Expand Down Expand Up @@ -976,12 +980,16 @@
"source": [
"# Retrieve `historical_new_capacity`\n",
"value = float(\n",
" scenario2.par(\"historical_new_capacity\", filters={\"technology\": \"coal_ppl\"}).value\n",
" scenario2.par(\n",
" \"historical_new_capacity\", filters={\"technology\": \"coal_ppl\"}\n",
" ).value.iloc[0]\n",
")\n",
"\n",
"# Retrieve `duration_period` for the year 700\n",
"duration_period = float(\n",
" scenario.par(\"duration_period\", filters={\"year\": scenario.firstmodelyear})[\"value\"]\n",
" scenario.par(\"duration_period\", filters={\"year\": scenario.firstmodelyear})[\n",
" \"value\"\n",
" ].iloc[0]\n",
")\n",
"\n",
"value *= duration_period\n",
Expand Down

0 comments on commit 4a0678f

Please sign in to comment.