Skip to content

Instantly share code, notes, and snippets.

View niftycode's full-sized avatar
🏠
Working from home

Bodo Schönfeld niftycode

🏠
Working from home
View GitHub Profile
@niftycode
niftycode / json_to_excel.py
Last active December 29, 2019 10:36
Read JSON data from a given URL and save the data as Excel file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Fetch JSON data and create an Excel file
Version: 1.1
Python 3.8
Date created: 14.12.2019
"""
@niftycode
niftycode / read_access_db.py
Created February 26, 2019 16:11
Read an Access Database using Python with the pyodbc module.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Read an Access Database using pyodbc
Version: 1.0
Python 3.7
Date created: 24.02.2019
"""
@niftycode
niftycode / koalition.py
Last active December 1, 2021 18:01
This is an example how to count words in a text file using Python 3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Author: @niftycode
Version: 1.3
Python 3.10
Date created: February 14th, 2018
Date modified: December 1st, 2021
@niftycode
niftycode / traffic_accidents_kiel.py
Last active June 19, 2021 16:35
Use Kiel's OpenData to visualize traffic accidents with Python and Pandas
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Traffic Accidents in Kiel, Germany
Python 3.6
last edited: May 19th, 2021
The data is provided by the City of Kiel, Germany
https://www.kiel.de/
@niftycode
niftycode / btw_2017.py
Created September 25, 2017 09:31
German Federal Election 2017 (Bundestagswahl)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Election, German Bundestag 2017
Version: 1.0
Python 3.6
Date created: 25/09/2017
"""
@niftycode
niftycode / election_presidentielle.py
Last active April 24, 2017 16:54
Election presidentielle 2017 - a bar chart created with Python and matplotlib
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-bright')
fig, ax = plt.subplots()
candidats = ('Marine Le Pen', 'Emmanuel Macron', 'François Fillon', 'Benoît Hamon', 'Jean-Luc Mélenchon')
voter = [21.7,23.9,20,6.3,19.2]
y_pos = np.arange(len(candidats))
@niftycode
niftycode / kiel_unfaelle.py
Last active June 19, 2021 15:49
Traffic Accidents in Kiel
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
kiel_unfaelle.py
version: 1.3
last edited: June 19th, 2021
The data is provided by the City of Kiel, Germany:
http://kiel.de/rathaus/statistik/open_data/index.php?id=de-sh-kiel_gesetze_justiz_strassenverkehsunfaelle_verkehrstote_verletzte_fahrerflucht
"""
@niftycode
niftycode / big-o-notation.py
Last active January 21, 2024 04:29
big-o-notation graph with Python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
big-o-notation.py:
Version: 0.2
Python 3.6
Date created: 22/03/2017
'''
@niftycode
niftycode / familyStatus.py
Last active December 10, 2016 14:53
Line graph that shows the family status of the citizens of Kiel, Germany
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Line graph of the familiy status of the citizens of Kiel, Germany.
The data is provided by the City of Kiel.
http://kiel.de/rathaus/statistik/open_data/index.php
familyStatus.py
version: 1.3
@niftycode
niftycode / elections_bw_1980-2016.py
Last active June 10, 2018 08:37
line graph example using Python3 and Matplotlib
import matplotlib.pyplot as plt
import numpy as np
# results for the greens and the cdu
gruene = np.array([5.3, 8.0, 7.9, 9.5, 12.1, 7.7, 11.7, 24.2, 30.3])
cdu = np.array([53.4, 51.9, 49.0, 39.6, 41.3, 44.8, 44.2, 39.0, 27.0])
fig, ax = plt.subplots()
xlabels = [1980, 1984, 1988, 1992, 1996, 2001, 2006, 2011, 2016]