Skip to content

Instantly share code, notes, and snippets.

Last active Jun 19, 2021
What would you like to do?
Traffic Accidents in Kiel
# -*- coding: utf-8 -*-
version: 1.3
last edited: June 19th, 2021
The data is provided by the City of Kiel, Germany:
import pandas as pd
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
df = pd.read_csv("kiel_unfaelle.csv", sep=";")
# print the first five rows
x = df['Jahr']
y = df['Unfaelle']
plt.title("Traffic Accidents in Kiel", size="x-large")
plt.ylabel("Quantity", size="x-large")
plt.xlabel("Year", size="x-large")
plt.plot(y, "*-", markersize=6, linewidth=1, color='b', label="Traffic Accidents")
plt.legend(loc=(0.4, 0.8))
ax.set_xticklabels(x, rotation='vertical')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment