From 62c2260c59f8ec191aaf380ac2bfeaa04951be6e Mon Sep 17 00:00:00 2001 From: Gabriel Stefanini Vicente Date: Tue, 19 Dec 2023 10:06:23 -0500 Subject: [PATCH] Update damage assessmemt summary statistics --- .../damage-assessment/damage-assessment.ipynb | 4047 +++++++++++++---- 1 file changed, 3177 insertions(+), 870 deletions(-) diff --git a/notebooks/damage-assessment/damage-assessment.ipynb b/notebooks/damage-assessment/damage-assessment.ipynb index cd9f3fa..7868559 100644 --- a/notebooks/damage-assessment/damage-assessment.ipynb +++ b/notebooks/damage-assessment/damage-assessment.ipynb @@ -6,7 +6,7 @@ "source": [ "# Visualizing Damage Estimation in Gaza\n", "\n", - "This Jupyter Notebook aims to provide a visual analysis of Synthetic Aperture Radar (SAR) data to assess and visualize potential damage in the Gaza Strip. SAR data, known for its ability to capture ground features and changes regardless of weather conditions or time of day, can be instrumental in identifying changes in infrastructure or land features following conflict or disasters." + "This notebook provides a visual analysis of Synthetic Aperture Radar (SAR) data to assess and visualize potential damage in the Gaza Strip. SAR data, known for its ability to capture ground features and changes regardless of weather conditions or time of day, can be instrumental in identifying changes in infrastructure or land features following conflict or disasters." ] }, { @@ -184,7 +184,7 @@ " \n", " \n", " \n", - " 2023-12-18T17:12:53.533172\n", + " 2023-12-19T10:04:52.933553\n", " image/svg+xml\n", " \n", " \n", @@ -221,7 +221,7 @@ "L 536.848482 488.64 \n", "L 111.705625 488.64 \n", "z\n", - "\" clip-path=\"url(#p0cc6678302)\" style=\"fill: #1f77b4\"/>\n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #1f77b4\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #1f77b4\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #1f77b4\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #1f77b4\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #1f77b4\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #ff7f0e\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #ff7f0e\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #ff7f0e\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #ff7f0e\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #ff7f0e\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #2ca02c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #2ca02c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #2ca02c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #2ca02c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: #2ca02c\"/>\n", " \n", " \n", " \n", " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -443,11 +443,11 @@ " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -491,11 +491,11 @@ " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -534,11 +534,11 @@ " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -588,11 +588,11 @@ " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -651,11 +651,11 @@ " \n", " \n", + "\" clip-path=\"url(#p481da336e1)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1009,12 +1009,12 @@ " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1070,7 +1070,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1185,7 +1185,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1236,7 +1236,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1286,7 +1286,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1848,8 +1848,8 @@ " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1991,7 +1966,7 @@ ], "source": [ "fig, ax = plt.subplots(figsize=(16, 8))\n", - "plt.suptitle(\"Gaza: Damage Percentage (%) by Building Type\", y=1.01, fontsize=20)\n", + "plt.suptitle(\"Gaza: Percentage of Damaged Buildings by Type\", y=1.01, fontsize=20)\n", "\n", "df.pivot_table(\"perc\", \"ADM2_EN\", \"type\")[\n", " [\"commercial\", \"industrial\", \"residential\"]\n", @@ -2057,671 +2032,671 @@ "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", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
 ADM2_ENtypedamagedtotalpercADM2_ENtypedamagedtotalperc
0Gaza134884180432.26%0Gaza134884180432.26%
1North Gaza76112859126.62%1North Gaza76112859126.62%
2Khan Younis56654011814.12%2Khan Younis56654011814.12%
3Deir Al-Balah40272844914.16%3Deir Al-Balah40272844914.16%
4Rafah32932375213.86%4Rafah32932375213.86%
5Gazaindustrial20746444.61%5Gazaindustrial20746444.61%
6Gazaapartments17034649.13%6Gazaapartments17034649.13%
7Gazaruins12819565.64%7Gazaruins12819565.64%
8North Gazaapartments11222250.45%8North Gazaapartments11222250.45%
9Deir Al-Balahresidential10543923.92%9Deir Al-Balahresidential10543923.92%
10North Gazaindustrial9224038.33%10North Gazaindustrial9224038.33%
11Gazaschool8814261.97%11Gazaschool8814261.97%
12Gazaresidential7215446.75%12Gazaresidential7215446.75%
13Khan Younisgreenhouse6821643.14%13Khan Younisgreenhouse6821643.14%
14Khan Younishouse5957710.23%14Khan Younishouse5957710.23%
15Khan Younisschool5910755.14%15Khan Younisschool5910755.14%
16North Gazaschool487861.54%16North Gazaschool487861.54%
17Khan Younisresidential4524218.60%17Khan Younisresidential4524218.60%
18Khan Younisapartments4120819.71%18Khan Younisapartments4120819.71%
19Deir Al-Balahindustrial3518219.23%19Deir Al-Balahindustrial3518219.23%
20Gazamosque345660.71%20Gazamosque345660.71%
21Deir Al-Balahgreenhouse309173.27%21Deir Al-Balahgreenhouse309173.27%
22Rafahgreenhouse3024761.21%22Rafahgreenhouse3024761.21%
23Deir Al-Balahhouse2726010.38%23Deir Al-Balahhouse2726010.38%
24Deir Al-Balahschool276045.00%24Deir Al-Balahschool276045.00%
25North Gazahouse2624810.48%25North Gazahouse2624810.48%
26Khan Younisindustrial2311320.35%26Khan Younisindustrial2311320.35%
27Gazahouse2210620.75%27Gazahouse2210620.75%
28Gazacommercial192965.52%28Gazacommercial192965.52%
29Gazahospital182669.23%29Gazahospital182669.23%
30Rafahschool152268.18%30Rafahschool152268.18%
31North Gazamosque132552.00%31North Gazamosque132552.00%
32Rafahindustrial135922.03%32Rafahindustrial135922.03%
33North Gazagreenhouse122414.98%33North Gazagreenhouse122414.98%
34Gazauniversity122157.14%34Gazauniversity122157.14%
35Gazapublic122744.44%35Gazapublic122744.44%
36Khan Younismosque83423.53%36Khan Younismosque83423.53%
37Rafahhouse81276.30%37Rafahhouse81276.30%
39Khan Youniscollege7977.78%39Khan Youniscollege7977.78%
40Gazagreenhouse71913.66%40Gazagreenhouse71913.66%
38North Gazahospital7977.78%38North Gazahospital7977.78%
41Gazaroof61060.00%41Gazaroof61060.00%
42North Gazapublic51827.78%42North Gazapublic51827.78%
43Khan Younishospital5862.50%43Khan Younishospital5862.50%
44Deir Al-Balahconstruction41330.77%44Deir Al-Balahconstruction41330.77%
45North Gazaroof3560.00%45North Gazaroof3560.00%
46Deir Al-Balahcommercial3650.00%46Deir Al-Balahcommercial3650.00%
47Khan Youniscommercial31127.27%47Khan Youniscommercial31127.27%
48Gazawarehouse3650.00%48Gazawarehouse3650.00%
49North Gazacommercial3650.00%49North Gazacommercial3650.00%
55Gazaservice2633.33%55Gazaservice2633.33%
57Rafahuniversity22100.00%57Rafahuniversity22100.00%
56Deir Al-Balahhospital22100.00%56Deir Al-Balahhospital22100.00%
54Gazaretail2366.67%54Gazaretail2366.67%
53Deir Al-Balahmosque22010.00%53Deir Al-Balahmosque22010.00%
52Deir Al-Balahapartments21811.11%52Deir Al-Balahapartments21811.11%
51Rafahapartments21513.33%51Rafahapartments21513.33%
50North Gazaresidential2219.52%50North Gazaresidential2219.52%
69Gazachurch11100.00%69Gazachurch11100.00%
79Deir Al-Balahhangar1520.00%79Deir Al-Balahhangar1520.00%
78Khan Younisconstruction1616.67%78Khan Younisconstruction1616.67%
77Khan Youniskindergarten11100.00%77Khan Youniskindergarten11100.00%
76Gazaoffice1520.00%76Gazaoffice1520.00%
75Khan Younisretail1250.00%75Khan Younisretail1250.00%
74Gazahotel11100.00%74Gazahotel11100.00%
73Khan Younisuniversity11100.00%73Khan Younisuniversity11100.00%
72Gazagarage1520.00%72Gazagarage1520.00%
71Gazadetached1425.00%71Gazadetached1425.00%
70Gazayes;public11100.00%70Gazayes;public11100.00%
60Rafahmosque1205.00%60Rafahmosque1205.00%
68North Gazakindergarten1250.00%68North Gazakindergarten1250.00%
67Gazaconstruction1714.29%67Gazaconstruction1714.29%
66Deir Al-Balahpublic1333.33%66Deir Al-Balahpublic1333.33%
65Deir Al-Balahservice1250.00%65Deir Al-Balahservice1250.00%
64Rafahresidential1714.29%64Rafahresidential1714.29%
63Rafahcommercial11100.00%63Rafahcommercial11100.00%
62Deir Al-Balahroof1250.00%62Deir Al-Balahroof1250.00%
61Rafahgreenhouse_horticult1616.67%61Rafahgreenhouse_horticult1616.67%
59Rafahhospital1250.00%59Rafahhospital1250.00%
58Deir Al-Balahwarehouse11100.00%58Deir Al-Balahwarehouse11100.00%
80Rafahwarehouse1812.50%80Rafahwarehouse1812.50%
\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -2798,7 +2773,7 @@ " if fclass in [\n", " \"tower\",\n", " \"wastewater_plant\",\n", - " \"water_tower\", \n", + " \"water_tower\",\n", " \"telephone\",\n", " \"water_well\",\n", " \"drinking_water\",\n", @@ -2809,10 +2784,9 @@ " \"pharmacy\",\n", " \"dentist\",\n", " \"doctors\",\n", - " \"hospital\", \n", + " \"hospital\",\n", " \"clinic\",\n", " \"nursing_home\",\n", - " \n", " ]:\n", " return \"Health\"\n", " if fclass in [\n", @@ -2820,8 +2794,8 @@ " \"police\",\n", " \"courthouse\",\n", " \"library\",\n", - " \"monument\", \n", - " \"post_office\", \n", + " \"monument\",\n", + " \"post_office\",\n", " \"memorial\",\n", " \"community_centre\",\n", " \"town_hall\",\n", @@ -2832,7 +2806,7 @@ " \"fire_station\",\n", " ]:\n", " return \"Public Amenities\"\n", - " \n", + "\n", " elif fclass in [\n", " \"clothes\",\n", " \"supermarket\",\n", @@ -2965,7 +2939,7 @@ " \n", " \n", " \n", - " 2023-12-18T17:12:54.169476\n", + " 2023-12-19T10:04:53.406389\n", " image/svg+xml\n", " \n", " \n", @@ -3002,7 +2976,7 @@ "L 961.991339 494.5536 \n", "L 111.705625 494.5536 \n", "z\n", - "\" clip-path=\"url(#pc87ec1a991)\" style=\"fill: #729ece\"/>\n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #729ece\"/>\n", "
\n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #729ece\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #729ece\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #729ece\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #729ece\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ff9e4a\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ff9e4a\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ff9e4a\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ff9e4a\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ff9e4a\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #67bf5c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #67bf5c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #67bf5c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #67bf5c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #67bf5c\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ed665d\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ed665d\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ed665d\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ed665d\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ed665d\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ad8bc9\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ad8bc9\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ad8bc9\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ad8bc9\"/>\n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: #ad8bc9\"/>\n", " \n", " \n", " \n", " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3304,11 +3278,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3342,11 +3316,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3390,11 +3364,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3446,11 +3420,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3489,11 +3463,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3538,11 +3512,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -3592,11 +3566,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4002,16 +3976,16 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4068,11 +4042,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4129,11 +4103,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4223,11 +4197,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4301,11 +4275,11 @@ " \n", " \n", + "\" clip-path=\"url(#p23e159f362)\" style=\"fill: none; stroke-dasharray: 0.925,0.4; stroke-dashoffset: 0; stroke: #808080; stroke-opacity: 0.5; stroke-width: 0.25\"/>\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -4960,58 +4934,59 @@ " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -5027,9 +5002,11 @@ ], "source": [ "fig, ax = plt.subplots(figsize=(16, 8))\n", - "plt.suptitle(\"Gaza: Damage Percentage of Points of Interest\", y=1.01, fontsize=20)\n", + "plt.suptitle(\"Gaza: Percentage of Damaged Points of Interest\", y=1.01, fontsize=20)\n", "\n", - "df.pivot_table(\"perc\", \"ADM2_EN\", \"type\").plot(ax=ax, kind=\"barh\", color=TableauMedium_10.mpl_colors)\n", + "df.pivot_table(\"perc\", \"ADM2_EN\", \"type\").plot(\n", + " ax=ax, kind=\"barh\", color=TableauMedium_10.mpl_colors\n", + ")\n", "\n", "# Add labels and customization\n", "ax.set_xlabel(\"% Damaged Points of Interest\", fontsize=12)\n", @@ -5087,223 +5064,223 @@ "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", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
 ADM2_ENtypedamagedtotalpercADM2_ENtypedamagedtotalperc
19Deir Al-BalahEducation121866.67%19Deir Al-BalahEducation121866.67%
12Deir Al-BalahHealth256936.23%12Deir Al-BalahHealth256936.23%
22Deir Al-BalahInfrastructure102540.00%22Deir Al-BalahInfrastructure102540.00%
3Deir Al-BalahPlaces of Economic Activity8556714.99%3Deir Al-BalahPlaces of Economic Activity8556714.99%
21Deir Al-BalahPublic Amenities103231.25%21Deir Al-BalahPublic Amenities103231.25%
7GazaEducation5410153.47%7GazaEducation5410153.47%
2GazaHealth19634357.14%2GazaHealth19634357.14%
10GazaInfrastructure264953.06%10GazaInfrastructure264953.06%
0GazaPlaces of Economic Activity730126557.71%0GazaPlaces of Economic Activity730126557.71%
6GazaPublic Amenities6813948.92%6GazaPublic Amenities6813948.92%
17Khan YounisEducation153148.39%17Khan YounisEducation153148.39%
13Khan YounisHealth247830.77%13Khan YounisHealth247830.77%
20Khan YounisInfrastructure113928.21%20Khan YounisInfrastructure113928.21%
4Khan YounisPlaces of Economic Activity8344518.65%4Khan YounisPlaces of Economic Activity8344518.65%
15Khan YounisPublic Amenities236336.51%15Khan YounisPublic Amenities236336.51%
9North GazaEducation345660.71%9North GazaEducation345660.71%
5North GazaHealth7412559.20%5North GazaHealth7412559.20%
14North GazaInfrastructure235145.10%14North GazaInfrastructure235145.10%
1North GazaPlaces of Economic Activity23848149.48%1North GazaPlaces of Economic Activity23848149.48%
11North GazaPublic Amenities266738.81%11North GazaPublic Amenities266738.81%
16RafahEducation173450.00%16RafahEducation173450.00%
23RafahHealth93525.71%23RafahHealth93525.71%
18RafahInfrastructure132259.09%18RafahInfrastructure132259.09%
8RafahPlaces of Economic Activity4315128.48%8RafahPlaces of Economic Activity4315128.48%
24RafahPublic Amenities63218.75%24RafahPublic Amenities63218.75%
\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -5367,21 +5344,2351 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": 15, "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [] + "tags": [ + "remove-cell" + ] }, + "outputs": [], "source": [ - "```{figure} ../../docs/images/logo.png\n", - "---\n", - "height: 0px\n", - "---\n", - "Percentage damage assessment estimation for each second-level administrative division and road type.\n", - "```" + "mapper = {\n", + " \"track\": \"Tracks\",\n", + " \"unclassified\": \"Unclassified\",\n", + " \"residential\": \"Other\",\n", + " \"tertiary\": \"Tertiary\",\n", + " \"service\": \"Other\",\n", + " \"secondary\": \"Secondary\",\n", + " \"track_grade3\": \"Tracks\",\n", + " \"track_grade5\": \"Tracks\",\n", + " \"trunk\": \"Other\",\n", + " \"path\": \"Other\",\n", + " \"track_grade4\": \"Tracks\",\n", + " \"primary\": \"Primary\",\n", + " \"secondary_link\": \"Secondary\",\n", + " \"footway\": \"Other\",\n", + " \"steps\": \"Other\",\n", + " \"tertiary_link\": \"Tertiary\",\n", + " \"trunk_link\": \"Other\",\n", + " \"pedestrian\": \"Other\",\n", + " \"primary_link\": \"Primary\",\n", + " \"living_street\": \"Other\",\n", + " \"unknown\": \"Unclassified\",\n", + " \"track_grade1\": \"Tracks\",\n", + "}\n", + "ROADS[\"type\"] = ROADS[\"fclass\"].replace(mapper)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "tags": [ + "remove-cell" + ] + }, + "outputs": [], + "source": [ + "left = (\n", + " ROADS[ROADS[\"_upd5max\"] >= 0.5]\n", + " .value_counts([\"ADM2_EN\", \"type\"])\n", + " .to_frame(\"damaged\")\n", + ")\n", + "right = ROADS.value_counts([\"ADM2_EN\", \"type\"]).to_frame(\"total\")\n", + "\n", + "df = pd.merge(left, right, on=[\"ADM2_EN\", \"type\"]).reset_index()\n", + "df[\"perc\"] = 100 * df[\"damaged\"] / df[\"total\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "tags": [ + "remove-cell" + ] + }, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " 2023-12-19T10:05:44.354492\n", + " image/svg+xml\n", + " \n", + " \n", + " Matplotlib v3.8.2, https://matplotlib.org/\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n" + ], + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots(figsize=(16, 8))\n", + "plt.suptitle(\"Gaza: Percentage of Damaged Roads\", y=1.01, fontsize=20)\n", + "\n", + "df.pivot_table(\"perc\", \"ADM2_EN\", \"type\").plot(\n", + " ax=ax, kind=\"barh\", color=ColorBlind_10.mpl_colors\n", + ")\n", + "\n", + "# Add labels and customization\n", + "ax.set_xlabel(\"% Damaged Roads\", fontsize=12)\n", + "ax.xaxis.set_major_formatter(FuncFormatter(lambda y, _: \"{}%\".format(y)))\n", + "ax.set_ylabel(\"Adm 2\", fontsize=16)\n", + "ax.set_yticklabels(df[\"ADM2_EN\"].unique(), fontsize=12)\n", + "ax.spines[\"right\"].set_visible(False)\n", + "ax.spines[\"top\"].set_visible(False)\n", + "\n", + "# Only show ticks on the left and bottom spines\n", + "ax.yaxis.set_ticks_position(\"left\")\n", + "ax.xaxis.set_ticks_position(\"bottom\")\n", + "ax.grid(which=\"both\", linestyle=\"--\", linewidth=0.25, color=\"gray\", alpha=0.5)\n", + "ax.legend(bbox_to_anchor=(1.01, 0.9))\n", + "\n", + "ax.set_title(\n", + " \"Estimated percentage of damaged roads for each second-level administrative division\",\n", + " fontsize=14,\n", + ")\n", + "ax.text(\n", + " 0,\n", + " -0.1,\n", + " \"Source: World Bank calculations derived from OpenStreetMap and Sentinel-1 data.\",\n", + " ha=\"left\",\n", + " va=\"center\",\n", + " transform=ax.transAxes,\n", + " fontsize=10,\n", + " color=\"black\",\n", + " weight=\"normal\",\n", + ");" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "```{figure} ../../docs/images/logo.png\n", + "---\n", + "height: 0px\n", + "---\n", + "Percentage damage assessment estimation for each second-level administrative division and road type.\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Alternatively, please see below the tabular data." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "remove-input", + "output_scroll" + ] + }, + "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", + "
 ADM2_ENtypedamagedtotalperc
3Deir Al-BalahOther73465298013.87%
24Deir Al-BalahSecondary7216184.45%
15Deir Al-BalahTertiary1024783713.07%
11Deir Al-BalahTracks1063349423.04%
23Deir Al-BalahUnclassified9438122.47%
0GazaOther243076967034.89%
14GazaPrimary1035185755.74%
5GazaSecondary44501171737.98%
6GazaTertiary2167664532.61%
13GazaTracks1039340433.05%
21GazaUnclassified15522586.86%
2Khan YounisOther121559825712.37%
18Khan YounisSecondary693561012.35%
10Khan YounisTertiary1079739214.60%
9Khan YounisTracks1088434132.51%
25Khan YounisUnclassified5728891.97%
1North GazaOther141934900528.96%
26North GazaPrimary232592.00%
7North GazaSecondary1569389440.29%
12North GazaTertiary1040397426.17%
19North GazaTracks678229992.95%
22North GazaUnclassified10738812.76%
4RafahOther65074765313.65%
27RafahPrimary83902.05%
17RafahSecondary721413117.45%
8RafahTertiary1226618919.81%
16RafahTracks848304872.78%
20RafahUnclassified16844773.75%
\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sort_values([\"ADM2_EN\", \"type\"]).style.format(\n", + " {\n", + " \"perc\": \"{:,.2f}%\",\n", + " },\n", + " precision=0,\n", + ")" ] }, {