This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import sqlsoup | |
db = sqlsoup.SQLSoup('sqlite:///pandas.db') | |
engine = db.engine | |
# Read Excel | |
df = pd.read_excel('excel_file.xlsx', | |
0, # Sheet | |
index_col=None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Small example hot to convert german special characters from unicode to utf-8 and back to unicode | |
# http://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?start=128&number=128&names=-&utf8=string-literal | |
# | |
umlaute_dict = { | |
'\xc3\xa4': 'ae', # U+00E4 \xc3\xa4 | |
'\xc3\xb6': 'oe', # U+00F6 \xc3\xb6 | |
'\xc3\xbc': 'ue', # U+00FC \xc3\xbc | |
'\xc3\x84': 'Ae', # U+00C4 \xc3\x84 | |
'\xc3\x96': 'Oe', # U+00D6 \xc3\x96 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod | |
def prepost(f): | |
def prepost_wrapper(self, *args, **kwargs): | |
print('prepost wrapper') | |
pre_name = 'pre_' + f.__name__ | |
post_name = 'post_' + f.__name__ | |
if hasattr(self, pre_name): |