Skip to content

Instantly share code, notes, and snippets.

Bodo Schönfeld niftycode

Block or report user

Report or block niftycode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@niftycode
niftycode / read_access_db.py
Created Feb 26, 2019
Read an Access Database using Python with the pyodbc module.
View read_access_db.py
#!/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
Created Feb 27, 2018
This is an example how to search for strings in a text file using Python 3
View koalition.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Program: koalition.py
Author: Bodo Schönfeld
Email: python@bodo-schoenfeld.de
Version: 1.0
Python 3.6
@niftycode
niftycode / traffic_accidents_kiel.py
Last active Oct 19, 2017
Use Kiel's OpenData to visualize traffic accidents with Python and Pandas
View traffic_accidents_kiel.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Traffic Accidents in Kiel, Germany
Python 3.6
last edited: 19/10/2017
The data is provided by the City of Kiel, Germany
https://www.kiel.de/
@niftycode
niftycode / btw_2017.py
Created Sep 25, 2017
German Federal Election 2017 (Bundestagswahl)
View btw_2017.py
#!/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 Apr 24, 2017
Election presidentielle 2017 - a bar chart created with Python and matplotlib
View election_presidentielle.py
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 Apr 10, 2017
Traffic Accidents in Kiel
View kiel_unfaelle.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
kiel_unfaelle.py
version: 1.2
last edited: 10/04/2017
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 Jul 25, 2018
big-o-notation graph with Python3
View big-o-notation.py
#!/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 Dec 10, 2016
Line graph that shows the family status of the citizens of Kiel, Germany
View familyStatus.py
#!/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 Jun 10, 2018
line graph example using Python3 and Matplotlib
View elections_bw_1980-2016.py
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]
@niftycode
niftycode / EpochConverter.cpp
Created Aug 24, 2016
Convert the UNIX time to a human readable string
View EpochConverter.cpp
/* EpochConverter */
#include <iostream>
#include <time.h>
using namespace std;
int main(int argc, const char * argv[]) {
int inputTime;
struct tm *timeinfo;
You can’t perform that action at this time.