Please scroll down for the English version
Goldberg - Record
Die folgende Anleitung soll eine Benutzung des Python-Skripts und eine Interpretation der Ergebnisse ermöglichen. Der Programmcode ist kompatibel mit der Python-Version 3.8.
Bibliotheken: Damit das Programm ausgeführt werden kann, sind ggf. noch weitere Bibliotheken lokal zu installieren. In den ersten Zeilen der Dateien sind die benutzten Bibliotheken angegeben.
Erstellung der Normform: Das Programm ist darauf ausgelegt, zwei Tabellen mit Personendaten zusammenzuführen. Dazu ist die Erstellung von Tabellen in normierter Form wichtig. Die Ausgestaltung dieser Tabellen ist im dazugehörigen Artikel erklärt. Da die zugrundeliegenden Daten sehr individuell beschaffen sein können, ist es auch die Überführung in die Normform. Hier wird für die im dazugehörigen Artikel verwendeten Leipziger Datenquellen exemplarisch die Erstellung der Normform dargestellt. In den jeweiligen Programmen („normform_KLF.py“ und „normform_KLK.py“) werden die zugrundeliegenden Daten hochgeladen, verarbeitet und als CSV-Datei wieder ausgegeben. Auf andere Datentabellen sind diese Programme nicht anwendbar. Sie bieten jedoch eine geeignete Grundlage zur Anpassung an andere Daten.
Eingangsdateien: Die aus den Normform-Programmen resultierenden CSV-Dateien müssen in „normform1.csv“ und „normform2.csv“ benannt werden. Wenn Personen aus einer Datenquelle zusammengeführt werden sollen, kann es sich um zwei Dateien mit identischem Inhalt handeln.
Verkürzung der Durchlaufzeit: Bei besonders umfangreichen Tabellen kann die Durchlaufzeit verkürzt werden, indem zu Beginn der „main.py“ die Variable sortingBySurnameGiven auf 1 gesetzt wird. Das hat zur Folge, dass die Datentabellen nach der Variable surnameGiven alphabetisch sortiert werden. Wenn „normform1.csv“ und „normform2.csv“ den identischen Inhalt aufweisen, werden in der Folge nur Personen zusammengeführt, deren Nachname (Variable surnameGiven) einen identischen ersten Buchstaben aufweist. Das bringt einen Nachteil für Fälle mit sich, in denen gleiche Personen unterschiedliche Anfangsbuchstaben in der Namensschreibweisen aufweisen (z. B. „Bauer“ und „Pauer“).
Ausgabedateien: Als Ergebnis wird die Datei „tableResult.csv“ erzeugt. Die jeweiligen Spalten sind mit Tabstopps voneinander separiert. Die Struktur der Tabelle entspricht der Normform. Allerdings sind zusätzlich die Spalten „idSource1“ und „idSource2“ vorhanden, über die nachvollzogen werden kann, welche Einträge zusammengeführt worden sind. Die Spalte „id“ heißt in der Ergebnistabelle zudem „idGlobal“.
Weitere Iterationen: Soll eine Datentabelle zusammengeführt werden, werden durch das Programm immer nur zwei gleiche Personen erkannt und zusammengeführt. Sind Personen jedoch mehrmals in der grundlegenden Tabelle vorhanden, kann die Ergebnistabelle wieder als „normform1.csv“ und „normform2.csv“ einer weiteren Iteration zugeführt werden. Hierbei ist jedoch zu beachten, dass aus der Ergebnistabelle die Spalten „idSource1“ und „idSource2“ gelöscht werden. Die Spalte „idGlobal“ muss zudem in „id“ umbenannt werden.
Jan Michael Goldberg, 04. Oktober 2022
Goldberg - Record
The following instructions are intended to enable the use of the Python script and an interpretation of the results. The program code is compatible with Python version 3.8.
Libraries: In order for the program to run, additional libraries may need to be installed locally. The libraries used are specified in the first lines of the files.
Creating the standard form (Normform): The program is designed to merge two tables with personal data. To do this, it is important to create tables in standard form. The design of these tables is explained in the corresponding article. As the underlying data can be very unique, the conversion into the standard form is individual as well. As an example, the creation of the standard form for the Leipzig data sources used in the corresponding article is described here. In the respective programs ("normform_KLF.py" and "normform_KLK.py"), the underlying data is uploaded, processed and output as a CSV file. These programs cannot be used for other data tables. However, they provide a suitable basis for adapting to other data.
Input files: The CSV files resulting from the Normform programs must be named "normform1.csv" and "normform2.csv". If persons from one data source are to be merged, there may be two files with identical content.
Shortening the processing time: For particularly large tables, the processing time can be shortened by setting the variable sortingBySurnameGiven to 1 at the start of "main.py". As a result, the data tables are sorted alphabetically according to the variable surnameGiven. If "normform1.csv" and "normform2.csv" have identical content, only people whose surname (variable surnameGiven) has an identical first letter will be merged. This entails a disadvantage for cases in which the same persons have different first letters in the spelling of their name (e.g. "Bauer" and "Pauer").
Output files: As a result, the file "tableResult.csv" is generated. The respective columns are separated from each other with tab stops. The structure of the table corresponds to the standard form. However, the columns "idSource1" and "idSource2" are also available, which can be used to trace which entries have been merged. The "id" column is also called "idGlobal" in the results table.
Further iterations: If a data table is to be merged, the program generally only recognizes and merges two identical persons. However, if persons are present more than once in the basic table, the results table can be added to another iteration as "normform1.csv" and "normform2.csv". Please note, however, that the columns "idSource1" and "idSource2" are deleted from the results table. Moreover, the column "idGlobal" must be renamed to "id".
Jan Michael Goldberg, October 04, 2022 (translated by Marie Adler, January 09, 2024)