I'm working on small program to work with excel data.But i cant seem to return the value from combo box so findTotal() doesn't work as intended
Excel file here: https://drive.google.com/open?id=1NYYzNvm_QlD2LbP0RLCwG8uuKf7chAC1
import tkinter as tk
from tkinter import ttk
from tkinter import *
import pandas as pd
df = pd.read_excel("some excel file")
def findTotal():
df["Total"] = (df["Oct"] + df["Nov"] + df["Dec"])*df["$ value"]
a = df.loc[(df.Country == combo.get()) & (df.incoterm == combo1.get())]
print(a.Total.sum()/len(a))
root = tk.Tk()
root.title("Data calculator")
root.configure(background="black")
root.resizable(0, 0)
canvas1 = Canvas(root, width=250, height=250, bg='lightsteelblue')
canvas1.pack()
combo = ttk.Combobox(root,
values=["USA", "Japan", "China", "Russia"])
combo1 = ttk.Combobox(root,
values=["EXW", "FOB", "DAT"])
But = Button(root, fg="red", text="Calculate", command=findTotal())
combo.current(1)
combo1.current(1)
canvas1.create_window(125, 50, window=combo)
canvas1.create_window(125, 110, window=combo1)
canvas1.create_window(125, 200, window=But)
root.mainloop()
When I run the program I get nan, actual output is somewhere around 2******