From 28630e05d1e50c7ca7817ca590a34f7f4c1f9286 Mon Sep 17 00:00:00 2001 From: dadams Date: Sun, 10 Aug 2025 20:17:58 -0700 Subject: [PATCH] remove 11 --- .../analysis10-2021.html | 10117 ++++++++++++++++ .../analysis11-ruca_2021.ipynb | 80 - 2 files changed, 10117 insertions(+), 80 deletions(-) create mode 100644 analysis/new analysis Aug 2025/analysis10-2021.html delete mode 100644 analysis/new analysis Aug 2025/analysis11-ruca_2021.ipynb diff --git a/analysis/new analysis Aug 2025/analysis10-2021.html b/analysis/new analysis Aug 2025/analysis10-2021.html new file mode 100644 index 0000000..3cff0b7 --- /dev/null +++ b/analysis/new analysis Aug 2025/analysis10-2021.html @@ -0,0 +1,10117 @@ + + + + + +analysis10-2021 + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + diff --git a/analysis/new analysis Aug 2025/analysis11-ruca_2021.ipynb b/analysis/new analysis Aug 2025/analysis11-ruca_2021.ipynb deleted file mode 100644 index 43a48ff..0000000 --- a/analysis/new analysis Aug 2025/analysis11-ruca_2021.ipynb +++ /dev/null @@ -1,80 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "00abdbfd", - "metadata": {}, - "source": [ - "## Colorado Spills Project\n", - "### incorporating rurality data\n", - "### Date: 2025-08-06\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "3dc76f74", - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import geopandas as gpd\n", - "import statsmodels.formula.api as smf\n", - "from sqlalchemy import create_engine\n", - "from dotenv import load_dotenv\n", - "import os\n", - "\n", - "load_dotenv()\n", - "\n", - "# Connect to your database\n", - "engine = create_engine(f\"postgresql+psycopg2://{os.getenv('DB_USER')}:{os.getenv('DB_PASSWORD')}@{os.getenv('DB_HOST')}:{os.getenv('DB_PORT')}/colorado_spills\")\n", - "\n", - "# Load data with geometry preserved\n", - "spills = gpd.read_postgis(\"SELECT * FROM spills_with_ruca\", engine, geom_col='geometry')\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "7e7219b8", - "metadata": {}, - "outputs": [], - "source": [ - "def classify_rurality(ruca_code):\n", - " if pd.isna(ruca_code):\n", - " return 'Unknown'\n", - " elif ruca_code <= 3:\n", - " return 'Urban'\n", - " elif ruca_code <= 6:\n", - " return 'Suburban'\n", - " else:\n", - " return 'Rural'\n", - "\n", - "spills['ruca_code'] = pd.to_numeric(spills['ruca_code'], errors='coerce')\n", - "spills['rurality'] = spills['ruca_code'].apply(classify_rurality)\n", - "spills = spills[spills['rurality'] != 'Unknown'] # drop unknowns\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "base", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}