Skip to content
Snippets Groups Projects
Commit de7f5637 authored by root's avatar root
Browse files

Added Example 12 KITA-SH

parent cc1b9bd4
No related branches found
No related tags found
No related merge requests found
12_KiTaSH/KITA-SH-example1.png

1.91 MiB

12_KiTaSH/KITA-SH-example2.png

1.51 MiB

12_KiTaSH/KITA-SH-example3.png

1.89 MiB

This diff is collapsed.
import plotly.express as px
import pandas as pd
import json
import time
# Read json file
with open("einrichtungen.json") as f:
data =json.load(f)
# create pandas dataframe on the list of "communeBottleneckMinutes"
df = pd.json_normalize(data, meta=[["address", "longitude"], ["address", "latitude"]])
# drop unwanted columns and rows with missing coordinates
df.drop(columns=["bilder", "imageIds"], inplace=True)
df.dropna(how='any', subset="address.latitude", inplace=True)
# Fill NaN values with a String
df.fillna("Nicht angegeben", inplace=True)
# Convert the timestamp to hours
df["openingHoursFrom"] = df["openingHoursFrom"].apply(lambda x: x/(60*60*1000))
df["openingHoursTo"] = df["openingHoursTo"].apply(lambda x: x/(60*60*1000))
# color_scale = [(0, 'orange'), (1,'red')]
# Create the map
fig = px.scatter_mapbox(df, #.loc[df["religioeseAusrichtung"] != 0]
lat="address.latitude",
lon="address.longitude",
hover_name="name",
hover_data=df.columns,
color="educationalConcept",
# color_continuous_scale=color_scale,
zoom=8,
height=800,
width=1700)
# Use Openstreetmap as map
fig.update_layout(mapbox_style="open-street-map")
# Remove the margin on the right, top, left and bottom side
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
\ No newline at end of file
...@@ -12,3 +12,4 @@ Example # | Name | Description | Input format | Output | Source ...@@ -12,3 +12,4 @@ Example # | Name | Description | Input format | Output | Source
08 | Water height diagram | Create a line diagram of the water height of the Stoer near Willenscharen for 2023 | CSV | Diagram (PNG) | https://opendata.schleswig-holstein.de/dataset/wasserstand-pegel-willenscharen-stor1 08 | Water height diagram | Create a line diagram of the water height of the Stoer near Willenscharen for 2023 | CSV | Diagram (PNG) | https://opendata.schleswig-holstein.de/dataset/wasserstand-pegel-willenscharen-stor1
10 | Redispatch SH-Netz AG | Show a scatter plot of the number of EEG plants of a commune and the amount of time the electricity supply needed to be reduced | CSV | Scatterplot (PNG) | https://opendata.schleswig-holstein.de/dataset/redispatch-2022-08 10 | Redispatch SH-Netz AG | Show a scatter plot of the number of EEG plants of a commune and the amount of time the electricity supply needed to be reduced | CSV | Scatterplot (PNG) | https://opendata.schleswig-holstein.de/dataset/redispatch-2022-08
11 | Power plant monitoring | Show a box plot (mean, variance, outliers) of the measures of genitron stations at different locations over a one week time window | CSV | Boxplot (PNG) | https://opendata.schleswig-holstein.de/dataset/kfu-messwerte-2024-07-29 11 | Power plant monitoring | Show a box plot (mean, variance, outliers) of the measures of genitron stations at different locations over a one week time window | CSV | Boxplot (PNG) | https://opendata.schleswig-holstein.de/dataset/kfu-messwerte-2024-07-29
12 | KITAs in SH | Show all KITAs colored in their respective educational concept on the OpenStreetMap and hover over for information about them | JSON | OpenStreetMap | https://opendata.schleswig-holstein.de/dataset/kindertagesstaetten-aktuell
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment