I'm trying to write a dictionary into an excel file:
import pandas as pd
d_bsp = {"Datum":"24.03.2020", "Anz.": 5, \
"Steuerung":"XY", "Test":"XY", "Auftrag":"1999080", \
"Fehlermeldung":"Error","Toleranzbereich":440,"Bauteil":"R80", \
"Artikelnummer":"120-0170114", "Ursache":"Shortcut", \
"Verursacher":"THT", "Reparatur":"Bauteil löten"}
df = pd.read_excel("Fehlererfassung.xlsx")
df = df.append(d_bsp, ignore_index = True)
df.to_excel("Fehlererfassung.xlsx")
The problem: It always puts new Columns into my existing excel file.
The excel file has this columns:
Datum, Anz., Steuerung, Test, Auftrag, Fehlermeldung, Toleranzbereich, Bauteil, Artikelnummer, Ursache, Verursacher, Reparatur
And if I start the code, the existing excel file looks like:
Unnamed 0, Datum, Anz., Steuerung, Test, Auftrag, Fehlermeldung, Toleranzbereich, Bauteil, Artikelnummer, Ursache, Verursacher, Reparatur
What is the problem?
Thank you.