From 14963a22b594031431750491c8cb873959a610f4 Mon Sep 17 00:00:00 2001 From: Tarun Kukreja Date: Tue, 22 Oct 2024 15:14:39 -0700 Subject: [PATCH 1/3] forest_fires_partial_complete --- ..._forest_fires_using_spatial_analysis.ipynb | 659 ++++-------------- 1 file changed, 143 insertions(+), 516 deletions(-) diff --git a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb index e86dfa3ccf..8d5fdd5b89 100644 --- a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb +++ b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ "import pandas as pd\n", "\n", "# create a Web GIS object\n", - "gis = GIS(profile='your_enterprise_profile')" + "gis = GIS(url=\"https://pythonapi.playground.esri.com/portal/\" , username=\"api_data_owner\", password=\"geosaurus_donot3xpose\")" ] }, { @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -65,19 +65,19 @@ "text/html": [ "
\n", " \n", "\n", "
\n", - " LA County Emergency Management\n", + " LA County Emergency Management\n", " \n", "
\n", "
Summary: Group providing data relevant to emergencies in Los Angeles, California, USA.\n", "
Description: None\n", "
Owner: api_data_owner\n", - "
Created: March 22, 2024\n", + "
Created: March 21, 2024\n", "\n", "
\n", "
\n", @@ -87,7 +87,7 @@ "" ] }, - "execution_count": 2, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -100,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -108,17 +108,17 @@ "text/html": [ "
\n", "
\n", - " \n", + " \n", " \n", " \n", "
\n", "\n", "
\n", - " Active California Fires\n", + " Active California Fires\n", " \n", - "
Fires in Southern California active during 2016-2017.Feature Layer Collection by api_data_owner\n", + "
Fires in Southern California active during 2016-2017.
Feature Layer Collection by api_data_owner\n", "
Last Modified: December 19, 2023\n", - "
0 comments, 6 views\n", + "
0 comments, 18 views\n", "
\n", "
\n", " " @@ -135,17 +135,17 @@ "text/html": [ "
\n", "
\n", - " \n", + " \n", " \n", " \n", "
\n", "\n", "
\n", - " Critical Infrastructure in Southern California\n", + " Critical Infrastructure in Southern California\n", " \n", - "
Essential facilities to public health and safety in Southern California.Feature Layer Collection by api_data_owner\n", + "
Essential facilities to public health and safety in Southern California.
Feature Layer Collection by api_data_owner\n", "
Last Modified: December 19, 2023\n", - "
0 comments, 6 views\n", + "
0 comments, 14 views\n", "
\n", "
\n", " " @@ -162,17 +162,17 @@ "text/html": [ "
\n", "
\n", - " \n", + " \n", " \n", " \n", "
\n", "\n", "
\n", - " LA County Infrastructure At Risk\n", + " LA County Infrastructure At Risk\n", " \n", - "
A Web Map with critical infrastructure at risk from fires.Web Map by api_data_owner\n", + "
A Web Map with critical infrastructure at risk from fires.
Web Map by api_data_owner\n", "
Last Modified: December 20, 2023\n", - "
0 comments, 5 views\n", + "
0 comments, 35 views\n", "
\n", "
\n", " " @@ -202,15 +202,23 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 16, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1a51d8d0698e41cc8204a3e1f93fc55c", + "version_major": 2, + "version_minor": 1 + }, + "text/plain": [ + "Map(center=[4035818.471878221, -13162788.84377388], extent={'xmin': -13195962.052030275, 'ymin': 3995849.73900…" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -233,29 +241,29 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "# add the active fires layer\n", "fires = items[0]\n", - "m.add_layer(fires)" + "m.content.add(fires)" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "# add our critical infrastructure layer\n", "infra = items[1]\n", - "m.add_layer(infra)" + "m.content.add(infra)" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -265,15 +273,23 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 20, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "bc391273aac84f78a85254584e513fe4", + "version_major": 2, + "version_minor": 1 + }, + "text/plain": [ + "Map(center=[4035818.471878221, -13162788.84377388], extent={'xmin': -13195962.052030275, 'ymin': 3995849.73900…" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -296,29 +312,57 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "#add the active fires layer to the map\n", - "m1.add_layer(fires)" + "m1.content.add(fires)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "#add the critical infrastructure layer to the map\n", - "m1.add_layer(infra)" + "m1.content.add(infra)" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 23, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "ERROR 000824: The tool is not licensed.\n", + "Failed.\n" + ] + }, + { + "ename": "Exception", + "evalue": "Job failed.", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mException\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[23], line 6\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# buffer the active fire boundaries and add as new content\u001b[39;00m\n\u001b[0;32m 5\u001b[0m timestamp \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m{\u001b[39m\u001b[38;5;124m:\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm_\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mH_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mM_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mS}\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mformat(datetime\u001b[38;5;241m.\u001b[39mdatetime\u001b[38;5;241m.\u001b[39mnow())\n\u001b[1;32m----> 6\u001b[0m firebuffers \u001b[38;5;241m=\u001b[39m \u001b[43mcreate_buffers\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfires\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mMiles\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mFire_Buffers_\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mtimestamp\u001b[49m\u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\features\\use_proximity.py:593\u001b[0m, in \u001b[0;36mcreate_buffers\u001b[1;34m(input_layer, distances, field, units, dissolve_type, ring_type, side_type, end_type, output_name, context, gis, estimate, future)\u001b[0m\n\u001b[0;32m 575\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 576\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minput_layer\u001b[39m\u001b[38;5;124m\"\u001b[39m: input_layer,\n\u001b[0;32m 577\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdistances\u001b[39m\u001b[38;5;124m\"\u001b[39m: distances,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 588\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfuture\u001b[39m\u001b[38;5;124m\"\u001b[39m: future,\n\u001b[0;32m 589\u001b[0m }\n\u001b[0;32m 590\u001b[0m params \u001b[38;5;241m=\u001b[39m inspect_function_inputs(\n\u001b[0;32m 591\u001b[0m fn\u001b[38;5;241m=\u001b[39mgis\u001b[38;5;241m.\u001b[39m_tools\u001b[38;5;241m.\u001b[39mfeatureanalysis\u001b[38;5;241m.\u001b[39m_tbx\u001b[38;5;241m.\u001b[39mcreate_buffers, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs\n\u001b[0;32m 592\u001b[0m )\n\u001b[1;32m--> 593\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_tools\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfeatureanalysis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_buffers\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\_impl\\tools.py:2539\u001b[0m, in \u001b[0;36m_FeatureAnalysisTools.create_buffers\u001b[1;34m(self, input_layer, distances, field, units, dissolve_type, ring_type, side_type, end_type, output_name, context, estimate, future)\u001b[0m\n\u001b[0;32m 2537\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m future:\n\u001b[0;32m 2538\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m gpjob\n\u001b[1;32m-> 2539\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[43mgpjob\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 2540\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m output_name \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbufferLayer\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m ret:\n\u001b[0;32m 2541\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ret[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbufferLayer\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_job.py:234\u001b[0m, in \u001b[0;36mGPJob.result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 232\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 233\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_is_fa:\n\u001b[1;32m--> 234\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_fa(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_future\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m 235\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_is_ra:\n\u001b[0;32m 236\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_ra(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_future\u001b[38;5;241m.\u001b[39mresult())\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\_base.py:456\u001b[0m, in \u001b[0;36mFuture.result\u001b[1;34m(self, timeout)\u001b[0m\n\u001b[0;32m 454\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m CancelledError()\n\u001b[0;32m 455\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m FINISHED:\n\u001b[1;32m--> 456\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__get_result\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 457\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 458\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTimeoutError\u001b[39;00m()\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\_base.py:401\u001b[0m, in \u001b[0;36mFuture.__get_result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 399\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception:\n\u001b[0;32m 400\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 401\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception\n\u001b[0;32m 402\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 403\u001b[0m \u001b[38;5;66;03m# Break a reference cycle with the exception in self._exception\u001b[39;00m\n\u001b[0;32m 404\u001b[0m \u001b[38;5;28mself\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\thread.py:58\u001b[0m, in \u001b[0;36m_WorkItem.run\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m---> 58\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 59\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[0;32m 60\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfuture\u001b[38;5;241m.\u001b[39mset_exception(exc)\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_support.py:328\u001b[0m, in \u001b[0;36m_future_op\u001b[1;34m(gptool, task_url, job_info, job_id, param_db, return_values, return_messages)\u001b[0m\n\u001b[0;32m 319\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_future_op\u001b[39m(\n\u001b[0;32m 320\u001b[0m gptool,\n\u001b[0;32m 321\u001b[0m task_url,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 326\u001b[0m return_messages,\n\u001b[0;32m 327\u001b[0m ):\n\u001b[1;32m--> 328\u001b[0m job_info \u001b[38;5;241m=\u001b[39m \u001b[43m_analysis_job_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgptool\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtask_url\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mjob_info\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 329\u001b[0m resp \u001b[38;5;241m=\u001b[39m _analysis_job_results(gptool, task_url, job_info, job_id)\n\u001b[0;32m 331\u001b[0m \u001b[38;5;66;03m# ---------------------async-out---------------------#\u001b[39;00m\n", + "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_support.py:246\u001b[0m, in \u001b[0;36m_analysis_job_status\u001b[1;34m(gptool, task_url, job_info)\u001b[0m\n\u001b[0;32m 243\u001b[0m num_messages \u001b[38;5;241m=\u001b[39m num\n\u001b[0;32m 245\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m job_response\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjobStatus\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesriJobFailed\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m--> 246\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mJob failed.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 247\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m job_response\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjobStatus\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesriJobCancelled\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m 248\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mJob cancelled.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "\u001b[1;31mException\u001b[0m: Job failed." + ] + } + ], "source": [ "from arcgis.features.use_proximity import create_buffers\n", "\n", @@ -337,7 +381,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -354,12 +398,12 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# add risk areas to map\n", - "m1.add_layer(firebuffers)" + "m1.content.add(firebuffers)" ] }, { @@ -375,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -389,7 +433,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": { "scrolled": true }, @@ -408,18 +452,15 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "[]" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "[]\n" + ] } ], "source": [ @@ -440,299 +481,9 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
name_1citylatitudeaddrln2linkaddrln1phonessourceshape_lenguse_type...date_updatnameinfo1analysisareaperimeter_acresobjectidinfo2statusSHAPE
0Fish Fire34.176673http://egis3.lacounty.gov/lms/?p=24626HSIP Freedom Gnis_cultural_fe24948.867757publish...2010-11-01Azusa Powerplant Conduit112.454712016-06-261085040242905Active{\"x\": -117.87199392299999, \"y\": 34.17666797600...
1Pony Fire34.157505http://egis3.lacounty.gov/lms/?p=26620HSIP Freedom Gnis_structures3787.741971publish...2010-11-01Motion Picture And Television Fund Hospital57.42822016-06-26108040244777Active{\"x\": -118.63618579399997, \"y\": 34.15750062100...
2Wheaton Fire34.280934http://egis3.lacounty.gov/lms/?p=27055HSIP Freedom Gnis_structures6262.26394publish...2011-05-03Pacoima Memorial Hospital60.1300132016-06-26894040280838Active{\"x\": -118.38329528399998, \"y\": 34.28092898200...
3Wheaton FirePacoima34.259185http://egis3.lacounty.gov/lms/?p=1355912653 Osborne St.818) 896-5271 (Primary)Current Services Locator6262.26394publish...2011-06-10Whiteman Airport60.1300132016-06-26894040281293Active{\"x\": -118.41329310599997, \"y\": 34.25918012100...
4Pony FireWoodland Hills34.170993http://egis3.lacounty.gov/lms/?p=7305601 De Soto Ave.Current Services Locator3787.741971publish...2011-06-27Kaiser Permanente - Woodland Hills Medical Center57.42822016-06-26108040281296Active{\"x\": -118.589727101, \"y\": 34.17098795700008, ...
5Wheaton FireSun Valley34.240153http://egis3.lacounty.gov/lms/?p=6379449 San Fernando Rd.Mental Health Resource - 24 hours Service/Inta...2116262.26394publish...2013-05-30Pacifica Hospital Of The Valley60.1300132016-06-26894040283163Active{\"x\": -118.39619134599997, \"y\": 34.24014857700...
6Wheaton FirePacoima34.274168http://egis3.lacounty.gov/lms/?p=7059912756 Van Nuys BlvdAdministrative (818) 898-1388 Ext.51115, WIC S...2116262.26394publish...2010-11-01Northeast Valley Health Corporation - Pacoima ...60.1300132016-06-26894040284438Active{\"x\": -118.41070642299997, \"y\": 34.27416334600...
\n", - "

7 rows × 43 columns

\n", - "
" - ], - "text/plain": [ - " name_1 city latitude addrln2 \\\n", - "0 Fish Fire 34.176673 \n", - "1 Pony Fire 34.157505 \n", - "2 Wheaton Fire 34.280934 \n", - "3 Wheaton Fire Pacoima 34.259185 \n", - "4 Pony Fire Woodland Hills 34.170993 \n", - "5 Wheaton Fire Sun Valley 34.240153 \n", - "6 Wheaton Fire Pacoima 34.274168 \n", - "\n", - " link addrln1 \\\n", - "0 http://egis3.lacounty.gov/lms/?p=24626 \n", - "1 http://egis3.lacounty.gov/lms/?p=26620 \n", - "2 http://egis3.lacounty.gov/lms/?p=27055 \n", - "3 http://egis3.lacounty.gov/lms/?p=13559 12653 Osborne St. \n", - "4 http://egis3.lacounty.gov/lms/?p=730 5601 De Soto Ave. \n", - "5 http://egis3.lacounty.gov/lms/?p=637 9449 San Fernando Rd. \n", - "6 http://egis3.lacounty.gov/lms/?p=70599 12756 Van Nuys Blvd \n", - "\n", - " phones \\\n", - "0 \n", - "1 \n", - "2 \n", - "3 818) 896-5271 (Primary) \n", - "4 \n", - "5 Mental Health Resource - 24 hours Service/Inta... \n", - "6 Administrative (818) 898-1388 Ext.51115, WIC S... \n", - "\n", - " source shape_leng use_type ... date_updat \\\n", - "0 HSIP Freedom Gnis_cultural_fe 24948.867757 publish ... 2010-11-01 \n", - "1 HSIP Freedom Gnis_structures 3787.741971 publish ... 2010-11-01 \n", - "2 HSIP Freedom Gnis_structures 6262.26394 publish ... 2011-05-03 \n", - "3 Current Services Locator 6262.26394 publish ... 2011-06-10 \n", - "4 Current Services Locator 3787.741971 publish ... 2011-06-27 \n", - "5 211 6262.26394 publish ... 2013-05-30 \n", - "6 211 6262.26394 publish ... 2010-11-01 \n", - "\n", - " name info1 analysisarea \\\n", - "0 Azusa Powerplant Conduit 112.45471 \n", - "1 Motion Picture And Television Fund Hospital 57.4282 \n", - "2 Pacoima Memorial Hospital 60.130013 \n", - "3 Whiteman Airport 60.130013 \n", - "4 Kaiser Permanente - Woodland Hills Medical Center 57.4282 \n", - "5 Pacifica Hospital Of The Valley 60.130013 \n", - "6 Northeast Valley Health Corporation - Pacoima ... 60.130013 \n", - "\n", - " perimeter_ acres objectid info2 status \\\n", - "0 2016-06-26 10850 40242905 Active \n", - "1 2016-06-26 1080 40244777 Active \n", - "2 2016-06-26 8940 40280838 Active \n", - "3 2016-06-26 8940 40281293 Active \n", - "4 2016-06-26 1080 40281296 Active \n", - "5 2016-06-26 8940 40283163 Active \n", - "6 2016-06-26 8940 40284438 Active \n", - "\n", - " SHAPE \n", - "0 {\"x\": -117.87199392299999, \"y\": 34.17666797600... \n", - "1 {\"x\": -118.63618579399997, \"y\": 34.15750062100... \n", - "2 {\"x\": -118.38329528399998, \"y\": 34.28092898200... \n", - "3 {\"x\": -118.41329310599997, \"y\": 34.25918012100... \n", - "4 {\"x\": -118.589727101, \"y\": 34.17098795700008, ... \n", - "5 {\"x\": -118.39619134599997, \"y\": 34.24014857700... \n", - "6 {\"x\": -118.41070642299997, \"y\": 34.27416334600... \n", - "\n", - "[7 rows x 43 columns]" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "at_risk_facilities = riskinfra.layers[0]\n", "df = at_risk_facilities.query(as_df=True) # read the returned features as a Pandas dataframe\n", @@ -748,107 +499,9 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "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", - "
namecat1post_id
0Azusa Powerplant ConduitPhysical Features24626.0
1Motion Picture And Television Fund HospitalHealth and Mental Health26620.0
2Pacoima Memorial HospitalHealth and Mental Health27055.0
3Whiteman AirportTransportation13559.0
4Kaiser Permanente - Woodland Hills Medical CenterHealth and Mental Health730.0
5Pacifica Hospital Of The ValleyHealth and Mental Health637.0
6Northeast Valley Health Corporation - Pacoima ...Health and Mental Health70599.0
\n", - "
" - ], - "text/plain": [ - " name \\\n", - "0 Azusa Powerplant Conduit \n", - "1 Motion Picture And Television Fund Hospital \n", - "2 Pacoima Memorial Hospital \n", - "3 Whiteman Airport \n", - "4 Kaiser Permanente - Woodland Hills Medical Center \n", - "5 Pacifica Hospital Of The Valley \n", - "6 Northeast Valley Health Corporation - Pacoima ... \n", - "\n", - " cat1 post_id \n", - "0 Physical Features 24626.0 \n", - "1 Health and Mental Health 26620.0 \n", - "2 Health and Mental Health 27055.0 \n", - "3 Transportation 13559.0 \n", - "4 Health and Mental Health 730.0 \n", - "5 Health and Mental Health 637.0 \n", - "6 Health and Mental Health 70599.0 " - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# view simplified risk facilities table\n", "df1_simplified = df[['name', 'cat1', 'post_id']]\n", @@ -857,7 +510,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -877,17 +530,9 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - } - ], + "outputs": [], "source": [ "# create new map over aoi\n", "m2 = gis.map('Los Angeles', 9)\n", @@ -908,22 +553,22 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#add the critical infrastructure layer to the map\n", - "m2.add_layer(infra)" + "m2.content.add(infra)" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# add at risk facilities layer to fresh map\n", - "m2.add_layer(riskinfra)\n", + "m2.content.add(riskinfra)\n", " " ] }, @@ -938,7 +583,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -954,9 +599,9 @@ "
\n", " LA County Infrastructure At Risk\n", " \n", - "
A Web Map with critical infrastructure at risk from fires.Web Map by api_data_owner\n", + "
A Web Map with critical infrastructure at risk from fires.
Web Map by api_data_owner\n", "
Last Modified: December 20, 2023\n", - "
0 comments, 5 views\n", + "
0 comments, 34 views\n", "
\n", " \n", " " @@ -965,7 +610,7 @@ "" ] }, - "execution_count": 23, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -977,19 +622,19 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 7, "metadata": { "scrolled": true }, "outputs": [], "source": [ - "# create a webmap from the item\n", - "webmap = arcgis.mapping.WebMap(webmapitem)" + "# create a web map from the item\n", + "webmap = gis.map(webmapitem)" ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -1002,25 +647,22 @@ ], "source": [ "# read the operational layers in our webmap\n", - "for lyr in webmap.layers:\n", - " if lyr['id'].startswith('At_Risk_Infrastructure'):\n", - " print(lyr['url'])" + "for lyr in webmap.content.layers:\n", + " if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n", + " print(lyr.url)" ] }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "'https://pythonapi.playground.esri.com/server/rest/services/Hosted/At_Risk_Infrastructure_2024_05_07_18_41_36/FeatureServer/0'" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "https://pythonapi.playground.esri.com/server/rest/services/Hosted/At_Risk_Infrastructure_2024_05_07_18_41_36/FeatureServer/0\n" + ] } ], "source": [ @@ -1030,15 +672,15 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "# update the url of the 'At Risk Infrastructure' layer in the web map\n", "\n", - "for lyr in webmap.layers:\n", - " if lyr['id'].startswith('At_Risk_Infrastructure'):\n", - " lyr['url'] = new_url" + "for lyr in webmap.content.layers:\n", + " if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n", + " lyr.url = new_url" ] }, { @@ -1060,17 +702,9 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - } - ], + "outputs": [], "source": [ "m3 = gis.map('Los Angeles', 9)\n", "m3" @@ -1090,16 +724,16 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ - "feature_layer_id = webmap.layers[0].itemId" + "feature_layer_id = webmap.content.layers[0].properties['serviceItemId']" ] }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -1115,9 +749,9 @@ "
\n", " At_Risk_Infrastructure_source\n", " \n", - "
Feature Layer Collection by api_data_owner\n", + "

Feature Layer Collection by api_data_owner\n", "
Last Modified: December 19, 2023\n", - "
0 comments, 12 views\n", + "
0 comments, 39 views\n", "
\n", " \n", " " @@ -1126,7 +760,7 @@ "" ] }, - "execution_count": 30, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -1138,7 +772,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1147,19 +781,12 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "m3.add_layer(featurelayer)" + "m3.content.add(featurelayer)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -1183,7 +810,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.11.0" }, "toc": { "base_numbering": 1, From 922be059b321864812159d07e1f1eee93d213155 Mon Sep 17 00:00:00 2001 From: Tarun Kukreja Date: Thu, 24 Oct 2024 14:22:48 -0700 Subject: [PATCH 2/3] sample notebook complete with map widget update --- ..._forest_fires_using_spatial_analysis.ipynb | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb index 8d5fdd5b89..cf3c23d0a5 100644 --- a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb +++ b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb @@ -41,7 +41,7 @@ "import pandas as pd\n", "\n", "# create a Web GIS object\n", - "gis = GIS(url=\"https://pythonapi.playground.esri.com/portal/\" , username=\"api_data_owner\", password=\"geosaurus_donot3xpose\")" + "gis = GIS(profile=\"your_enterprise_profile\")" ] }, { @@ -334,35 +334,7 @@ "cell_type": "code", "execution_count": 23, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "ERROR 000824: The tool is not licensed.\n", - "Failed.\n" - ] - }, - { - "ename": "Exception", - "evalue": "Job failed.", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mException\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[23], line 6\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# buffer the active fire boundaries and add as new content\u001b[39;00m\n\u001b[0;32m 5\u001b[0m timestamp \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m{\u001b[39m\u001b[38;5;124m:\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm_\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mH_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mM_\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mS}\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mformat(datetime\u001b[38;5;241m.\u001b[39mdatetime\u001b[38;5;241m.\u001b[39mnow())\n\u001b[1;32m----> 6\u001b[0m firebuffers \u001b[38;5;241m=\u001b[39m \u001b[43mcreate_buffers\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfires\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m4\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mMiles\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mFire_Buffers_\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mtimestamp\u001b[49m\u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\features\\use_proximity.py:593\u001b[0m, in \u001b[0;36mcreate_buffers\u001b[1;34m(input_layer, distances, field, units, dissolve_type, ring_type, side_type, end_type, output_name, context, gis, estimate, future)\u001b[0m\n\u001b[0;32m 575\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 576\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minput_layer\u001b[39m\u001b[38;5;124m\"\u001b[39m: input_layer,\n\u001b[0;32m 577\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdistances\u001b[39m\u001b[38;5;124m\"\u001b[39m: distances,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 588\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfuture\u001b[39m\u001b[38;5;124m\"\u001b[39m: future,\n\u001b[0;32m 589\u001b[0m }\n\u001b[0;32m 590\u001b[0m params \u001b[38;5;241m=\u001b[39m inspect_function_inputs(\n\u001b[0;32m 591\u001b[0m fn\u001b[38;5;241m=\u001b[39mgis\u001b[38;5;241m.\u001b[39m_tools\u001b[38;5;241m.\u001b[39mfeatureanalysis\u001b[38;5;241m.\u001b[39m_tbx\u001b[38;5;241m.\u001b[39mcreate_buffers, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs\n\u001b[0;32m 592\u001b[0m )\n\u001b[1;32m--> 593\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_tools\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfeatureanalysis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_buffers\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\_impl\\tools.py:2539\u001b[0m, in \u001b[0;36m_FeatureAnalysisTools.create_buffers\u001b[1;34m(self, input_layer, distances, field, units, dissolve_type, ring_type, side_type, end_type, output_name, context, estimate, future)\u001b[0m\n\u001b[0;32m 2537\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m future:\n\u001b[0;32m 2538\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m gpjob\n\u001b[1;32m-> 2539\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[43mgpjob\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 2540\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m output_name \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbufferLayer\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m ret:\n\u001b[0;32m 2541\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ret[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbufferLayer\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_job.py:234\u001b[0m, in \u001b[0;36mGPJob.result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 232\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 233\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_is_fa:\n\u001b[1;32m--> 234\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_fa(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_future\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m 235\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_is_ra:\n\u001b[0;32m 236\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_ra(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_future\u001b[38;5;241m.\u001b[39mresult())\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\_base.py:456\u001b[0m, in \u001b[0;36mFuture.result\u001b[1;34m(self, timeout)\u001b[0m\n\u001b[0;32m 454\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m CancelledError()\n\u001b[0;32m 455\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m FINISHED:\n\u001b[1;32m--> 456\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__get_result\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 457\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 458\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTimeoutError\u001b[39;00m()\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\_base.py:401\u001b[0m, in \u001b[0;36mFuture.__get_result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 399\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception:\n\u001b[0;32m 400\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 401\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception\n\u001b[0;32m 402\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 403\u001b[0m \u001b[38;5;66;03m# Break a reference cycle with the exception in self._exception\u001b[39;00m\n\u001b[0;32m 404\u001b[0m \u001b[38;5;28mself\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\concurrent\\futures\\thread.py:58\u001b[0m, in \u001b[0;36m_WorkItem.run\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m---> 58\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 59\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[0;32m 60\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfuture\u001b[38;5;241m.\u001b[39mset_exception(exc)\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_support.py:328\u001b[0m, in \u001b[0;36m_future_op\u001b[1;34m(gptool, task_url, job_info, job_id, param_db, return_values, return_messages)\u001b[0m\n\u001b[0;32m 319\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_future_op\u001b[39m(\n\u001b[0;32m 320\u001b[0m gptool,\n\u001b[0;32m 321\u001b[0m task_url,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 326\u001b[0m return_messages,\n\u001b[0;32m 327\u001b[0m ):\n\u001b[1;32m--> 328\u001b[0m job_info \u001b[38;5;241m=\u001b[39m \u001b[43m_analysis_job_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgptool\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtask_url\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mjob_info\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 329\u001b[0m resp \u001b[38;5;241m=\u001b[39m _analysis_job_results(gptool, task_url, job_info, job_id)\n\u001b[0;32m 331\u001b[0m \u001b[38;5;66;03m# ---------------------async-out---------------------#\u001b[39;00m\n", - "File \u001b[1;32m~\\.conda\\envs\\geosaurus_dev_env\\Lib\\site-packages\\arcgis\\geoprocessing\\_support.py:246\u001b[0m, in \u001b[0;36m_analysis_job_status\u001b[1;34m(gptool, task_url, job_info)\u001b[0m\n\u001b[0;32m 243\u001b[0m num_messages \u001b[38;5;241m=\u001b[39m num\n\u001b[0;32m 245\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m job_response\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjobStatus\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesriJobFailed\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m--> 246\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mJob failed.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 247\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m job_response\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjobStatus\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mesriJobCancelled\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m 248\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mJob cancelled.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[1;31mException\u001b[0m: Job failed." - ] - } - ], + "outputs": [], "source": [ "from arcgis.features.use_proximity import create_buffers\n", "\n", From de295660bcc8640bd6c2b239f09466d24cf89396 Mon Sep 17 00:00:00 2001 From: Tarun Kukreja Date: Thu, 24 Oct 2024 14:49:05 -0700 Subject: [PATCH 3/3] dataframe output now visible --- ..._forest_fires_using_spatial_analysis.ipynb | 406 +++++++++++++++++- 1 file changed, 387 insertions(+), 19 deletions(-) diff --git a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb index cf3c23d0a5..8e48a6e1a8 100644 --- a/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb +++ b/samples/04_gis_analysts_data_scientists/fighting_california_forest_fires_using_spatial_analysis.ipynb @@ -275,23 +275,7 @@ "cell_type": "code", "execution_count": 20, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "bc391273aac84f78a85254584e513fe4", - "version_major": 2, - "version_minor": 1 - }, - "text/plain": [ - "Map(center=[4035818.471878221, -13162788.84377388], extent={'xmin': -13195962.052030275, 'ymin': 3995849.73900…" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# create a map of our area of interest\n", "m1 = gis.map('Los Angeles', 9)\n", @@ -455,7 +439,295 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "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", + "
name_1citylatitudeaddrln2linkaddrln1phonessourceshape_lenguse_type...date_updatnameinfo1analysisareaperimeter_acresobjectidinfo2statusSHAPE
0Fish Fire34.176673http://egis3.lacounty.gov/lms/?p=24626HSIP Freedom Gnis_cultural_fe24948.867757publish...2010-11-01Azusa Powerplant Conduit112.454712016-06-261085040242905Active{\"x\": -117.87199392299999, \"y\": 34.17666797600...
1Pony Fire34.157505http://egis3.lacounty.gov/lms/?p=26620HSIP Freedom Gnis_structures3787.741971publish...2010-11-01Motion Picture And Television Fund Hospital57.42822016-06-26108040244777Active{\"x\": -118.63618579399997, \"y\": 34.15750062100...
2Wheaton Fire34.280934http://egis3.lacounty.gov/lms/?p=27055HSIP Freedom Gnis_structures6262.26394publish...2011-05-03Pacoima Memorial Hospital60.1300132016-06-26894040280838Active{\"x\": -118.38329528399998, \"y\": 34.28092898200...
3Wheaton FirePacoima34.259185http://egis3.lacounty.gov/lms/?p=1355912653 Osborne St.818) 896-5271 (Primary)Current Services Locator6262.26394publish...2011-06-10Whiteman Airport60.1300132016-06-26894040281293Active{\"x\": -118.41329310599997, \"y\": 34.25918012100...
4Pony FireWoodland Hills34.170993http://egis3.lacounty.gov/lms/?p=7305601 De Soto Ave.Current Services Locator3787.741971publish...2011-06-27Kaiser Permanente - Woodland Hills Medical Center57.42822016-06-26108040281296Active{\"x\": -118.589727101, \"y\": 34.17098795700008, ...
5Wheaton FireSun Valley34.240153http://egis3.lacounty.gov/lms/?p=6379449 San Fernando Rd.Mental Health Resource - 24 hours Service/Inta...2116262.26394publish...2013-05-30Pacifica Hospital Of The Valley60.1300132016-06-26894040283163Active{\"x\": -118.39619134599997, \"y\": 34.24014857700...
6Wheaton FirePacoima34.274168http://egis3.lacounty.gov/lms/?p=7059912756 Van Nuys BlvdAdministrative (818) 898-1388 Ext.51115, WIC S...2116262.26394publish...2010-11-01Northeast Valley Health Corporation - Pacoima ...60.1300132016-06-26894040284438Active{\"x\": -118.41070642299997, \"y\": 34.27416334600...
\n", + "

7 rows × 43 columns

\n", + "
" + ], + "text/plain": [ + " name_1 city latitude addrln2 \\\n", + "0 Fish Fire 34.176673 \n", + "1 Pony Fire 34.157505 \n", + "2 Wheaton Fire 34.280934 \n", + "3 Wheaton Fire Pacoima 34.259185 \n", + "4 Pony Fire Woodland Hills 34.170993 \n", + "5 Wheaton Fire Sun Valley 34.240153 \n", + "6 Wheaton Fire Pacoima 34.274168 \n", + "\n", + " link addrln1 \\\n", + "0 http://egis3.lacounty.gov/lms/?p=24626 \n", + "1 http://egis3.lacounty.gov/lms/?p=26620 \n", + "2 http://egis3.lacounty.gov/lms/?p=27055 \n", + "3 http://egis3.lacounty.gov/lms/?p=13559 12653 Osborne St. \n", + "4 http://egis3.lacounty.gov/lms/?p=730 5601 De Soto Ave. \n", + "5 http://egis3.lacounty.gov/lms/?p=637 9449 San Fernando Rd. \n", + "6 http://egis3.lacounty.gov/lms/?p=70599 12756 Van Nuys Blvd \n", + "\n", + " phones \\\n", + "0 \n", + "1 \n", + "2 \n", + "3 818) 896-5271 (Primary) \n", + "4 \n", + "5 Mental Health Resource - 24 hours Service/Inta... \n", + "6 Administrative (818) 898-1388 Ext.51115, WIC S... \n", + "\n", + " source shape_leng use_type ... date_updat \\\n", + "0 HSIP Freedom Gnis_cultural_fe 24948.867757 publish ... 2010-11-01 \n", + "1 HSIP Freedom Gnis_structures 3787.741971 publish ... 2010-11-01 \n", + "2 HSIP Freedom Gnis_structures 6262.26394 publish ... 2011-05-03 \n", + "3 Current Services Locator 6262.26394 publish ... 2011-06-10 \n", + "4 Current Services Locator 3787.741971 publish ... 2011-06-27 \n", + "5 211 6262.26394 publish ... 2013-05-30 \n", + "6 211 6262.26394 publish ... 2010-11-01 \n", + "\n", + " name info1 analysisarea \\\n", + "0 Azusa Powerplant Conduit 112.45471 \n", + "1 Motion Picture And Television Fund Hospital 57.4282 \n", + "2 Pacoima Memorial Hospital 60.130013 \n", + "3 Whiteman Airport 60.130013 \n", + "4 Kaiser Permanente - Woodland Hills Medical Center 57.4282 \n", + "5 Pacifica Hospital Of The Valley 60.130013 \n", + "6 Northeast Valley Health Corporation - Pacoima ... 60.130013 \n", + "\n", + " perimeter_ acres objectid info2 status \\\n", + "0 2016-06-26 10850 40242905 Active \n", + "1 2016-06-26 1080 40244777 Active \n", + "2 2016-06-26 8940 40280838 Active \n", + "3 2016-06-26 8940 40281293 Active \n", + "4 2016-06-26 1080 40281296 Active \n", + "5 2016-06-26 8940 40283163 Active \n", + "6 2016-06-26 8940 40284438 Active \n", + "\n", + " SHAPE \n", + "0 {\"x\": -117.87199392299999, \"y\": 34.17666797600... \n", + "1 {\"x\": -118.63618579399997, \"y\": 34.15750062100... \n", + "2 {\"x\": -118.38329528399998, \"y\": 34.28092898200... \n", + "3 {\"x\": -118.41329310599997, \"y\": 34.25918012100... \n", + "4 {\"x\": -118.589727101, \"y\": 34.17098795700008, ... \n", + "5 {\"x\": -118.39619134599997, \"y\": 34.24014857700... \n", + "6 {\"x\": -118.41070642299997, \"y\": 34.27416334600... \n", + "\n", + "[7 rows x 43 columns]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + }], "source": [ "at_risk_facilities = riskinfra.layers[0]\n", "df = at_risk_facilities.query(as_df=True) # read the returned features as a Pandas dataframe\n", @@ -473,7 +745,103 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "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", + "
namecat1post_id
0Azusa Powerplant ConduitPhysical Features24626.0
1Motion Picture And Television Fund HospitalHealth and Mental Health26620.0
2Pacoima Memorial HospitalHealth and Mental Health27055.0
3Whiteman AirportTransportation13559.0
4Kaiser Permanente - Woodland Hills Medical CenterHealth and Mental Health730.0
5Pacifica Hospital Of The ValleyHealth and Mental Health637.0
6Northeast Valley Health Corporation - Pacoima ...Health and Mental Health70599.0
\n", + "
" + ], + "text/plain": [ + " name \\\n", + "0 Azusa Powerplant Conduit \n", + "1 Motion Picture And Television Fund Hospital \n", + "2 Pacoima Memorial Hospital \n", + "3 Whiteman Airport \n", + "4 Kaiser Permanente - Woodland Hills Medical Center \n", + "5 Pacifica Hospital Of The Valley \n", + "6 Northeast Valley Health Corporation - Pacoima ... \n", + "\n", + " cat1 post_id \n", + "0 Physical Features 24626.0 \n", + "1 Health and Mental Health 26620.0 \n", + "2 Health and Mental Health 27055.0 \n", + "3 Transportation 13559.0 \n", + "4 Health and Mental Health 730.0 \n", + "5 Health and Mental Health 637.0 \n", + "6 Health and Mental Health 70599.0 " + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + }], "source": [ "# view simplified risk facilities table\n", "df1_simplified = df[['name', 'cat1', 'post_id']]\n",