From c755e4313cfb81bce4f2eb63556d5d1cf5f06059 Mon Sep 17 00:00:00 2001 From: anitagraser Date: Mon, 8 Feb 2021 09:16:18 +0100 Subject: [PATCH] Fix air quality reading --- notebooks/environment.ipynb | 14 ++++++++------ notebooks/index.ipynb | 2 +- notebooks/utils/dataaccess.py | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/notebooks/environment.ipynb b/notebooks/environment.ipynb index 5618a22..c664e64 100644 --- a/notebooks/environment.ipynb +++ b/notebooks/environment.ipynb @@ -25,7 +25,7 @@ "import hvplot.pandas\n", "import pandas as pd\n", "import geopandas as gpd\n", - "from utils.dataaccess import gdf_from_wfs, get_weather_df, get_heatvulnerabilityindex_gdf" + "from utils.dataaccess import gdf_from_wfs, get_airquality_df, get_heatvulnerabilityindex_gdf" ] }, { @@ -43,7 +43,7 @@ "metadata": {}, "outputs": [], "source": [ - "heatvulidx = get_heatvulnerabilityindex_gdf()" + "uhvi = get_heatvulnerabilityindex_gdf()" ] }, { @@ -52,14 +52,16 @@ "metadata": {}, "outputs": [], "source": [ - "heatvulidx.hvplot(geo=True, tiles='OSM', c='AVG_UHVI_A', title='Average Urban Heat Vulnerability Index - All age groups').opts(active_tools=['wheel_zoom'])" + "uhvi.hvplot(geo=True, tiles='OSM', c='AVG_UHVI_A', title='Average Urban Heat Vulnerability Index - All age groups').opts(active_tools=['wheel_zoom'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Air Quality" + "## Air Quality\n", + "\n", + "Dataset: [Luftmessnetz: aktuelle Messdaten Wien](https://www.data.gv.at/katalog/dataset/luftmessnetz-aktuelle-messdaten-wien/)" ] }, { @@ -78,8 +80,8 @@ "metadata": {}, "outputs": [], "source": [ - "weather = get_weather_df()\n", - "weather" + "air_quality = get_airquality_df()\n", + "air_quality" ] }, { diff --git a/notebooks/index.ipynb b/notebooks/index.ipynb index 156b7b5..903e4ee 100644 --- a/notebooks/index.ipynb +++ b/notebooks/index.ipynb @@ -19,7 +19,7 @@ "## Lab notebooks\n", "\n", "1. [Accessing geodata from data.wien.gv.at services](wien-ogd.ipynb)\n", - "1. [Environmental conditions in Vienna](environment.ipynb)\n", + "1. [Monitoring environmental conditions in Vienna](environment.ipynb)\n", "1. [Geocoding addresses](geocoding.ipynb)\n", "1. [Getting elevation information](elevation.ipynb)" ] diff --git a/notebooks/utils/dataaccess.py b/notebooks/utils/dataaccess.py index 70580bb..83841db 100644 --- a/notebooks/utils/dataaccess.py +++ b/notebooks/utils/dataaccess.py @@ -49,14 +49,14 @@ def get_elevation(point): elevationall = line.split(' ', 1 )[1] return int(elevationall) -def get_weather_df(): +def get_airquality_df(): """ Get data from https://go.gv.at/l9lumesakt """ file = 'lumesakt.csv' url = 'https://go.gv.at/l9lumesakt' urlretrieve(url, file) - df = pd.read_csv(file) + df = pd.read_csv(file, sep=';', encoding='latin1') return df def get_heatvulnerabilityindex_df():