Error: "in submit_fields SeriesA = df1['TYPE']"

Howdy everybody!
I am a complete newbie to python, but i’m going in hard :slight_smile: :laughing:

i am having a problem gettin my code to work. My window shows up but when i click the submit button, i get an error. I’m attaching my code below:

from tkinter import *
import pandas as pd
def submit_fields():
path = “excel_original.xlsx”
df1 = pd.read_excel(path, sheet_name=[‘Sheet1’])
SeriesA = df1[‘TYPE’]
SeriesA = df1[‘TYPE’]
SeriesB = df1[‘BF’]
SeriesC = df1[‘TOB’]
SeriesD = df1[‘VERSION’]
SeriesE = df1[‘SG’]
SeriesF = df1[‘PE_HOLE’]
A = pd.Series(entry1.get())
B = pd.Series(entry2.get())
C = pd.Series(entry3.get())
D = pd.Series(entry4.get())
E = pd.Series(entry5.get())
F = pd.Series(entry6.get())
SeriesA = SeriesA.append(A)
SeriesB = SeriesB.append(B)
SeriesC = SeriesC.append(C)
SeriesC= SeriesD.append(D)
SeriesE= SeriesE.append(E)
SeriesF= SeriesF.append(F)
df2 = pd.DataFrame({“TYPE”:SeriesA, “BF”:SeriesB, “TOB”:SeriesC,“VERSION”:SeriesD,
“SG”:SeriesE, “PE_HOLE”:SeriesF})
df2 = pd.DataFrame({“TYPE”:SeriesA, “BF”:SeriesB})
df2.to_excel(path, index=False)

#clear entries after pressing the SUBMIT button
entry1.delete(0, END)
entry2.delete(0, END)
entry3.delete(0, END)
entry4.delete(0, END)
entry5.delete(0, END)
entry6.delete(0, END)


##Window/WIndow Characteristics
master = Tk()
#Window/WIndow Characteristics

##Labels/Labels’ Characteristics
Label(master, text=“TYPE”,width=20, anchor=“center”).grid(row=0)
Label(master, text=“BF”,width=20, anchor=“center”).grid(row=1)
Label(master, text=“TOB”,width=20, anchor=“center”).grid(row=2)
Label(master, text=“VERSION”,width=20, anchor=“center”).grid(row=3)
Label(master, text=“SG”,width=20, anchor=“center”).grid(row=4)
Label(master, text=“PE_HOLE”,width=20, anchor=“center”).grid(row=5)
#Labels/Labels’ Characteristics

entry1 = Entry(master)
entry2 = Entry(master)
entry3 = Entry(master)
entry4 = Entry(master)
entry5 = Entry(master)
entry6 = Entry(master)

##add text boxes
entry1.grid(row=0, column=1)
entry2.grid(row=1, column=1)
entry3.grid(row=2, column=1)
entry4.grid(row=3, column=1)
entry5.grid(row=4, column=1)
entry6.grid(row=5, column=1)
#add text boxes

Button(master, text=‘Quit’,relief=RAISED,command=master.quit).grid(row=6,column=0, pady=4)
Button(master, text=‘Submit’,relief=RAISED,command=submit_fields).grid(row=6,column=1, pady=4)

Hi Jaye,

Can you show us the error you get, or is it a secret? :slight_smile:

Please copy and paste the full traceback you get, starting with the line
“Traceback…” going all the way to final error message. The traceback
shows lots of useful information that will help solve your problem.

Otherwise we have to guess.