Skip to content

Instantly share code, notes, and snippets.

@jze
Created September 24, 2020 07:05
Show Gist options
  • Save jze/a35d66671a8fbe924febfa8ebf811237 to your computer and use it in GitHub Desktop.
Save jze/a35d66671a8fbe924febfa8ebf811237 to your computer and use it in GitHub Desktop.
Beispiel für Auswertung der Parkplatzbelegung in Scharbeutz
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
df_P1 = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Haffkrug_P1_2020-09-23.csv',sep=';',decimal=',')
df_P1['timestamp'] = pd.to_datetime(df_P1['timestamp'])
df_P2 = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Scharbeutz_P2_2020-09-23.csv',sep=';',decimal=',')
df_P2['timestamp'] = pd.to_datetime(df_P2['timestamp'])
df_P3 = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Scharbeutz_P3_2020-09-23.csv',sep=';',decimal=',')
df_P3['timestamp'] = pd.to_datetime(df_P3['timestamp'])
df_P4 = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Scharbeutz_P4_2020-09-23.csv',sep=';',decimal=',')
df_P4['timestamp'] = pd.to_datetime(df_P4['timestamp'])
df_Badeweg = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Scharbeutz_Badeweg_2020-09-23.csv',sep=';',decimal=',')
df_Badeweg['timestamp'] = pd.to_datetime(df_Badeweg['timestamp'])
df_Strandallee = pd.read_csv('https://opendata.zitsh.de/data/scharbeutz/Parkplatz_Scharbeutz_Parkbuchten_Strandallee_II_2020-09-23.csv',sep=';',decimal=',')
df_Strandallee['timestamp'] = pd.to_datetime(df_Strandallee['timestamp'])
fig, ax = plt.subplots(figsize=(8, 4))
ax.plot( 'timestamp', 'value', data=df_P1, marker='', linewidth=2)
ax.plot( 'timestamp', 'value', data=df_P2, marker='', linewidth=2)
ax.plot( 'timestamp', 'value', data=df_P3, marker='', linewidth=2)
ax.plot( 'timestamp', 'value', data=df_P4, marker='', linewidth=2)
ax.plot( 'timestamp', 'value', data=df_Badeweg, marker='', linewidth=2)
ax.plot( 'timestamp', 'value', data=df_Strandallee, marker='', linewidth=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment