-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nanoteilchen
committed
Jul 15, 2020
1 parent
22e5d6b
commit fca9b28
Showing
5 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type,donations_grants,sponsorship,registration_fees,travel_accommodation,fees,related_expenses,total,source | ||
hcp_amount,,,0.0,0.0,8000.0,0.0,8000.0,mitsubishi | ||
hco_amount,,0.0,0.0,0.0,0.0,0.0,0.0,mitsubishi | ||
rnd,,,,,,,0.0,mitsubishi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name,location,country,address,plz,uci,donations_grants,sponsorship,registration_fees,travel_accommodation,fees,related_expenses,total,type,source | ||
Adriano Bont,Winterthur,CH,"Neurowinterthur, Brunngasse 6",8400,,,,,,500.0,,500.0,hcp,mitsubishi | ||
David Czell,Baar,CH,"Zuger Kantonsspital, Landhausstr. 11",6340,,,,,,500.0,,500.0,hcp,mitsubishi | ||
Hans H. Jung,Zürich,CH,"Universitätsspital Zürich, Frauenklinikstr. 26",8091,,,,,,2500.0,,2500.0,hcp,mitsubishi | ||
Kai Rösler,Basel,CH,"Neurozentrum Basel, Marktplatz 5",4001,,,,,,800.0,30.0,830.0,hcp,mitsubishi | ||
Eduard Scherer,Winterthur,CH,"KS Winterthur, Brauerstr. 15",8400,,,,,,500.0,38.5,538.5,hcp,mitsubishi | ||
Jürgen Schneider,Nottwil,CH,"Paralegiezentrum Nottwil, Guido A. Zäch-Str. 1",6207,,,,,,500.0,53.7,553.7,hcp,mitsubishi | ||
Simone Sutherland,Basel,CH,"ECPM, Klingelbergstr. 61",4031,,,,,,8850.0,71.8,8921.8,hcp,mitsubishi | ||
Konrad Scheglmann,Zürich,CH,"Neurozentrum Bellevue, Theaterstr. 8",8001,,,,,,500.0,,500.0,hcp,mitsubishi | ||
Ansgar Studer,Zürich,CH,"Neurozentrum Hirslanden, Witellikerstr. 40",8032,,,,,,500.0,,500.0,hcp,mitsubishi | ||
Alexander Tarnutzer,Baden,CH,"KS Baden, Im Ergel 1",5404,,,,,,500.0,58.6,558.6,hcp,mitsubishi | ||
Reto Tscholl,Winterthur,CH,"Neurologische Gemeinschaftspraxis, Oberer Graben 4",8400,,,,,,500.0,,500.0,hcp,mitsubishi | ||
Markus Weber,St. Gallen,CH,"Kantonsspital St. Gallen, Rorschacher Str. 95",9007,,,,,,20106.8,220.0,20326.8,hcp,mitsubishi | ||
Björn Zörner,Zürich,CH,"Universitätsklinik Balgrist, Forchstr. 340",8008,,,,,,500.0,,500.0,hcp,mitsubishi | ||
Centre Hospitalier Universitaire Vaudois (CHUV),Lausanne,CH,Rue du Bugnon 46,1011,,,,,,2500.0,,2500.0,hco,mitsubishi | ||
Ente Ospedaliero Cantonale (EOC),Bellizona,CH,Viale Officina 3,6500,,,,,,5500.0,202.0,5702.0,hco,mitsubishi | ||
Forum für medizinische Fortbildung - FomF GmbH,Zug,CH,Ahornstr. 2,6300,,,12500.0,,,,,12500.0,hco,mitsubishi | ||
Haemostasis in Critical Care GmbH,St. Gallen,CH,Frohbergstr. 3,9001,,,5500.0,,,,,5500.0,hco,mitsubishi | ||
HRF Fribourg,Fribourg,CH,Chemin de Pensionnats 2-6,1708,,,,,,500.0,,500.0,hco,mitsubishi | ||
Hôpitaux universitaires de Genève (HUG),Geneve,CH,Rue Gabrielle-Perret-Gentil 4,1211,,,,,,2500.0,,2500.0,hco,mitsubishi | ||
Inselspital Bern,Bern,CH,Freiburgstr.,3010,,,,,,5000.0,,5000.0,hco,mitsubishi | ||
Instituto Oncologico della Swizzera Italiana e Laboratorio di Ematologica,Bellizona,CH,(OEsOpLeAdBa)le San Giovanni,6500,,,1000.0,,,,,1000.0,hco,mitsubishi | ||
Kantonsspital Aarau AG,Aarau,CH,Tellstrasse 25,5001,,,,,,2300.0,,2300.0,hco,mitsubishi | ||
Luzerner Kantonsspital,Luzern,CH,Sptialstrasse,6000,,,,,,500.0,,500.0,hco,mitsubishi | ||
Neurozentrum Oberaargau,Langenthal,CH,St. Urbanstrasse 22,4900,,,1500.0,,,,,1500.0,hco,mitsubishi | ||
Schweizerische Gesellschaft für Intensivmedizin (SGI),Basel,CH,Münsterberg 1,4001,,,5120.0,,,,,5120.0,hco,mitsubishi | ||
Schweizerische Förderation der Klinischen Neuro-Gesellschaften (SFCNS,Basel,CH,Münsterberg 1,4001,,,35000.0,,,,,35000.0,hco,mitsubishi | ||
Schweizerische Neurologische Gesellschaft,Basel,CH,Münsterberg 1,4001,,,3000.0,,,,,3000.0,hco,mitsubishi | ||
Universitätsspital Basel,Basel,CH,Petersgraben 4,4031,,,,,,3300.0,,3300.0,hco,mitsubishi | ||
Universitäts-Kinderspital beider Basel (UKBB),Basel,CH,Spitalstrasse 33 / Postfach,4031,,,,,,800.0,16.4,816.4,hco,mitsubishi | ||
Université d’automne d’ENMG,La Chaux-de-fonds,CH,Case postale 1103,2301,,,1000.0,,,,,1000.0,hco,mitsubishi | ||
Vitasphère Gesundheitszentrum Bützberg AG,Thunstetten,CH,Bernstrasse 37,4922,,,,,,800.0,50.0,850.0,hco,mitsubishi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Mitsubishi - List" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import sys\n", | ||
"sys.path.insert(0, '../../../lib/')\n", | ||
"\n", | ||
"import tabula\n", | ||
"import numpy as np\n", | ||
"import pandas as pd\n", | ||
"import importlib\n", | ||
"import re\n", | ||
"\n", | ||
"import pdfexport\n", | ||
"importlib.reload(pdfexport)\n", | ||
"\n", | ||
"from pdfexport import *\n", | ||
"import consts" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Import PDF" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Read pdf into DataFrame\n", | ||
"df = tabula.read_pdf(\"Transparenz_2019_Schweiz.pdf\", pages='all', lattice=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Format Table" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 23, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"saved\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"df_export = df.copy()\n", | ||
"\n", | ||
"#Rename Columns\n", | ||
"df_export.columns = ['empty0', 'name', 'address', 'plz', 'location', 'uci', 'empty1', 'donations_grants', 'sponsorship', 'registration_fees', 'travel_accommodation', 'fees', 'related_expenses']\n", | ||
"\n", | ||
"#Remove rows which have no values\n", | ||
"df_export = df_export.dropna(subset=['location'], how='all')\n", | ||
"df_export = df_export.dropna(subset=['name'], how='all')\n", | ||
"\n", | ||
"#Remove empty\n", | ||
"df_export.drop(columns=['empty1', 'empty0'], inplace=True)\n", | ||
"\n", | ||
"#Remove by string\n", | ||
"df_export = df_export[~df_export['plz'].str.contains('n.a.', False)]\n", | ||
"df_export = df_export.reset_index(drop=True)\n", | ||
"\n", | ||
"#Remove Titles\n", | ||
"df_export['name'] = df_export.name.str.replace(regex_title, '', regex=True, case=False)\n", | ||
"df_export['name'] = df_export.name.str.strip()\n", | ||
"\n", | ||
"#Type\n", | ||
"df_export = set_type_by_alphabetical_order(df_export, lastname_before_name = False)\n", | ||
"\n", | ||
"#Cleanup Numbers\n", | ||
"df_export['total'] = 0\n", | ||
"df_export = remove_dots(df_export)\n", | ||
"df_export = replace_comma_to_dot(df_export)\n", | ||
"df_export = remove_in_numbers(df_export, 'CHF ')\n", | ||
"df_export = remove_in_numbers(df_export, 'na')\n", | ||
"df_export = amounts_to_number(df_export)\n", | ||
"\n", | ||
"#Sum\n", | ||
"df_export = sum_amounts(df_export)\n", | ||
"\n", | ||
"#Add Country\n", | ||
"df_export['country'] = 'CH'\n", | ||
"\n", | ||
"#basic string conversion\n", | ||
"df_export = basic_string_conversion(df_export)\n", | ||
"\n", | ||
"#Save\n", | ||
"export_list(df_export, 'mitsubishi')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#write_to_csv(df_export, 'tmp.csv', True)\n", | ||
"#write_to_excel(df_export, 'tmp.xlsx', open=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
121 changes: 121 additions & 0 deletions
121
data/1. pdfexport/files/Mitsubishi/1. Accumulations.ipynb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Mitsubishi - Accumulations\n", | ||
"## Beachten\n", | ||
"* Manuell erfassen" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import sys\n", | ||
"sys.path.insert(0, '../../../lib/')\n", | ||
"\n", | ||
"import tabula\n", | ||
"import numpy as np\n", | ||
"import pandas as pd\n", | ||
"import importlib\n", | ||
"\n", | ||
"import pdfexport\n", | ||
"importlib.reload(pdfexport)\n", | ||
"\n", | ||
"from pdfexport import *" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Format Table" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"hcp_count not found or not unique\n", | ||
"hco_count not found or not unique\n", | ||
"saved\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#Empty Dataset\n", | ||
"df_export = pd.DataFrame(columns=fix_columns_accumulations[:-1])\n", | ||
"\n", | ||
"#HCP\n", | ||
"df_export = add_accumulation(df_export, AccType.hcp_amount,\n", | ||
" donations_grants = '',\n", | ||
" sponsorship = '',\n", | ||
" registration_fees = 0 ,\n", | ||
" travel_accommodation = 0,\n", | ||
" fees = 8000,\n", | ||
" related_expenses = 0\n", | ||
" )\n", | ||
"#HCO\n", | ||
"df_export = add_accumulation(df_export, AccType.hco_amount,\n", | ||
" donations_grants = '',\n", | ||
" sponsorship = 0,\n", | ||
" registration_fees = 0,\n", | ||
" travel_accommodation = 0,\n", | ||
" fees = 0,\n", | ||
" related_expenses = 0\n", | ||
" )\n", | ||
"#RND\n", | ||
"df_export = add_accumulation(df_export, AccType.rnd, total = 57547)\n", | ||
"\n", | ||
"#Numberize\n", | ||
"df_export = amounts_to_number(df_export)\n", | ||
"\n", | ||
"#Sum\n", | ||
"df_export = sum_amounts(df_export)\n", | ||
"\n", | ||
"#Export\n", | ||
"export_acumulations(df_export, 'mitsubishi')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#write_to_csv(df_export, 'tmp.csv')\n", | ||
"#write_to_excel(df_export, 'tmp.xlsx')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Binary file not shown.