From 8a04a089ec6dcb5967475eb82fae2ae9a0aa33d2 Mon Sep 17 00:00:00 2001 From: SahitiSarva Date: Tue, 4 Jun 2024 12:56:43 +0000 Subject: [PATCH] deploy: 9b64b966d99d6291ce4258b868b9343b2562f3dd --- _sources/notebooks/conflict/acled.ipynb | 21 ++++--- _sources/notebooks/houthis/houthis-tax.ipynb | 25 ++++---- notebooks/conflict/acled.html | 61 ++++---------------- searchindex.js | 2 +- 4 files changed, 40 insertions(+), 69 deletions(-) diff --git a/_sources/notebooks/conflict/acled.ipynb b/_sources/notebooks/conflict/acled.ipynb index 4de6fab..988850d 100644 --- a/_sources/notebooks/conflict/acled.ipynb +++ b/_sources/notebooks/conflict/acled.ipynb @@ -52,7 +52,7 @@ "sys.path.append(join(git_root, \"src\", \"red_sea_monitoring\"))\n", "import visuals\n", "import acled\n", - "#from red_sea_monitoring.acled import *\n", + "# from red_sea_monitoring.acled import *\n", "\n", "from datetime import date\n", "\n", @@ -541,7 +541,12 @@ ], "source": [ "m = grouped_data.explore(\n", - " column=\"nr_fatalities\", zoom_start=5.1, marker_kwds={\"radius\": 5}, vmin=1, vmax=50, cmap ='viridis'\n", + " column=\"nr_fatalities\",\n", + " zoom_start=5.1,\n", + " marker_kwds={\"radius\": 5},\n", + " vmin=1,\n", + " vmax=50,\n", + " cmap=\"viridis\",\n", ")\n", "m" ] @@ -1257,7 +1262,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Weekly Conflict Events in the Red Sea Region (excluding protests)" + "### Weekly Conflict Events in the South Red Sea Region (excluding protests)" ] }, { @@ -1385,9 +1390,7 @@ "outputs": [], "source": [ "conflict_red_sea = (\n", - " conflict_red_sea.groupby(\n", - " [\"country\", \"event_date\", \"location\"]\n", - " )[\"fatalities\"]\n", + " conflict_red_sea.groupby([\"country\", \"event_date\", \"location\"])[\"fatalities\"]\n", " .agg([\"sum\", \"count\"])\n", " .reset_index()\n", ")\n", @@ -1485,7 +1488,11 @@ { "cell_type": "code", "execution_count": 82, - "metadata": {}, + "metadata": { + "tags": [ + "remove-input" + ] + }, "outputs": [ { "data": { diff --git a/_sources/notebooks/houthis/houthis-tax.ipynb b/_sources/notebooks/houthis/houthis-tax.ipynb index 663b78d..c44d9cb 100644 --- a/_sources/notebooks/houthis/houthis-tax.ipynb +++ b/_sources/notebooks/houthis/houthis-tax.ipynb @@ -10,8 +10,7 @@ }, "outputs": [], "source": [ - "import pandas as pd\n", - "import numpy as np\n" + "import pandas as pd" ] }, { @@ -37,9 +36,9 @@ }, "outputs": [], "source": [ - "fbx = pd.read_excel('../../data/Freightos Baltic Index.xlsx')\n", - "fbx['date'] = fbx['date'].apply(lambda x: pd.to_datetime(x))\n", - "fbx['FBX'] = fbx['FBX'].astype(float)" + "fbx = pd.read_excel(\"../../data/Freightos Baltic Index.xlsx\")\n", + "fbx[\"date\"] = fbx[\"date\"].apply(lambda x: pd.to_datetime(x))\n", + "fbx[\"FBX\"] = fbx[\"FBX\"].astype(float)" ] }, { @@ -87,7 +86,7 @@ " bab_el_mandeb.groupby(pd.Grouper(key=\"date\", freq=\"W\"))[\"n_total\"]\n", " .sum()\n", " .reset_index()\n", - ")#.merge(fbx, on = 'date')" + ") # .merge(fbx, on = 'date')" ] }, { @@ -160,7 +159,7 @@ ], "source": [ "from bokeh.plotting import figure, show, output_notebook\n", - "from bokeh.models import Legend, Span, LinearAxis, Range1d, Label, Spacer, Div\n", + "from bokeh.models import Legend, Span, LinearAxis, Range1d, Label, Div\n", "from bokeh.layouts import column\n", "\n", "# Call this to display plots inline in a Jupyter Notebook\n", @@ -182,7 +181,7 @@ "subtitle = Div(\n", " text=f\"
{subtitle_text}
\",\n", " width=1000,\n", - " height=30\n", + " height=30,\n", ")\n", "\n", "# Add a subtitle\n", @@ -199,7 +198,9 @@ "\n", "\n", "# Plot multiple lines\n", - "p1 = p.line(bab_el_mandeb[\"date\"], bab_el_mandeb[\"n_total\"], line_width=2, color=\"#B07AA1\")\n", + "p1 = p.line(\n", + " bab_el_mandeb[\"date\"], bab_el_mandeb[\"n_total\"], line_width=2, color=\"#B07AA1\"\n", + ")\n", "p.y_range = Range1d(start=0, end=600)\n", "p.extra_y_ranges = {\"y2\": Range1d(start=900, end=4000)}\n", "p.add_layout(LinearAxis(y_range_name=\"y2\", axis_label=\"y2\"), \"right\")\n", @@ -213,7 +214,6 @@ ")\n", "\n", "\n", - "\n", "legend_items = [\n", " (\"Number of Vessels\", [p1]),\n", " # (\"Number of events in Yemen\", [p2]),\n", @@ -277,7 +277,10 @@ "p.add_layout(conflict_label)\n", "\n", "\n", - "layout = column(p, subtitle,)\n", + "layout = column(\n", + " p,\n", + " subtitle,\n", + ")\n", "# Show the plot\n", "show(layout)" ] diff --git a/notebooks/conflict/acled.html b/notebooks/conflict/acled.html index e4da774..7505f9a 100644 --- a/notebooks/conflict/acled.html +++ b/notebooks/conflict/acled.html @@ -444,7 +444,7 @@

Contents

  • Insights