Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
Anita Graser f2c7bdea96 Fixed plot title 2022-12-09 12:34:55 +01:00
Anita Graser 7df1b60a2b Fixed data path 2022-12-09 12:34:29 +01:00
Anita Graser 3776d2f806 Better default parameter range 2022-12-09 12:34:17 +01:00
Anita Graser 89bd009ff2 Add linked selections example 2022-12-09 12:34:00 +01:00
4 zmienionych plików z 67 dodań i 10 usunięć

Wyświetl plik

@ -92,7 +92,63 @@
"outputs": [],
"source": [
"col = 'airtemp °C'\n",
"stations.join(air_quality).dropna(subset=[col]).hvplot(geo=True, tiles='StamenToner', c=col, size=500, title=col.title())"
"stations = stations.join(air_quality).dropna(subset=[col])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"stations.hvplot(geo=True, tiles='StamenToner', c=col, size=500, title=col.title())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from holoviews.selection import link_selections"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"my_map = stations.hvplot(geo=True, tiles='CartoLight', c=col, cmap='Viridis', size=200, title=col.title(), width=400, height=250)\n",
"my_scatter = pd.DataFrame(stations).hvplot.scatter(x='airtemp °C', y='windspeed kmh', width=250, height=250)\n",
"my_hist = pd.DataFrame(stations).hvplot.hist('airtemp °C', width=250, height=250)\n",
"link_selections(my_map + my_hist + my_scatter , index_cols=['id'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import panel as pn"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def my_plot(my_col='airtemp °C'):\n",
" try: \n",
" my_map = stations.hvplot(geo=True, tiles='CartoLight', c=my_col, cmap='Viridis', size=200, title=my_col, width=400, height=250)\n",
" my_hist = pd.DataFrame(stations).hvplot.hist(my_col, title=my_col, width=250, height=250)\n",
" return link_selections(my_map + my_hist, index_cols=['id']) \n",
" except:\n",
" pass\n",
"kw = dict(my_col=air_quality.columns)\n",
"pn.interact(my_plot, **kw)"
]
},
{
@ -105,7 +161,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@ -119,7 +175,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.7.15"
}
},
"nbformat": 4,

Wyświetl plik

@ -107,7 +107,7 @@
"metadata": {},
"outputs": [],
"source": [
"kw = dict(user_input=\"Giefinggasse 2, 1210 Wien\", buffer_meters=(0,10000))\n",
"kw = dict(user_input=\"Giefinggasse 2, 1210 Wien\", buffer_meters=(1,10000))\n",
"pn.interact(my_plot, **kw)"
]
},
@ -147,7 +147,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.7.15"
}
},
"nbformat": 4,

Wyświetl plik

@ -133,7 +133,7 @@ def get_uber_movement_gdf():
gdf['MOVEMENT_ID'] = gdf['MOVEMENT_ID'].astype(int)
gdf.set_index('MOVEMENT_ID', inplace=True)
file = 'uber_vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
file = 'data/uber_vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
url = 'https://github.com/anitagraser/ogd-at-lab-data/raw/main/uber/vienna-statistical_areas-2020-1-All-MonthlyAggregate.zip'
if not exists(file):
urlretrieve(url, file)

Wyświetl plik

@ -8,9 +8,10 @@
"\n",
"[![Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/anitagraser/ogd-at-lab/main?urlpath=lab/tree/notebooks/wien-ogd.ipynb)\n",
"\n",
"\n",
"<a href=\"https://www.data.gv.at/auftritte/?organisation=stadt-wien\"><img align=\"right\" src=\"./img/stadt-wien.png\"></a>\n",
"\n",
"This notebook demonstrates the use of vector data provided via WFS. For instructions on using WMS, see the [webmapping notebook](webmapping.ipynb).\n",
"\n",
"For more information on open government data in Vienna visit [digitales.wien.gv.at](https://digitales.wien.gv.at/site/open-data/)\n",
"\n",
"For a full list of available datasets go to [data.gv.at](https://www.data.gv.at/auftritte/?organisation=stadt-wien&searchterm=&formatFilter%5B%5D=WFS)\n",
@ -95,7 +96,7 @@
"metadata": {},
"outputs": [],
"source": [
"hvplot_with_buffer(gdf, 100, title='Citybike Stations') + hvplot_with_buffer(gdf2, 100, title='EV Charging Stations')"
"hvplot_with_buffer(gdf, 100, title='Bike Sharing Stations') + hvplot_with_buffer(gdf2, 100, title='EV Charging Stations')"
]
},
{
@ -118,7 +119,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@ -132,7 +133,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.7.15"
}
},
"nbformat": 4,