I have a program where a user inputs an excel file, the program runs some data analysis and then shows the data tables in a tkinter gui using pandastable library. With the pandastable library, users can delete outliers in the table but I can't figure out how to save the updated table back in my program so I can run the data analysis again without the outlying values.
I have a tkinter button set up for this but am stuck on the command function:
for(tab, table) in zip(tab_control, analyzed_data):
frame = LabelFrame(tab, text='Analyzed Data')
frame.grid(row=0, column=0)
data_table = Table(frame, dataframe=table)
data_table.show()
# Right now, this button runs the remove_outliers function when the button is formed but does not run again when the button is clicked
remove_outliers_btn = tk.Button(tab, text='Remove Outliers', fg='white', bg='blue', width=20, command=lambda: remove_outliers(table))
remove_outliers_btn.grid(row=1, column=0)
Below is the command I've tried to use but it runs when the tkinter window is getting set up and then does not run again when I actually click on the button:
def remove_outliers(table):
updated_table = table
print(updated_table)
where the idea is that, I have a list of data tables that are being created and displayed in the tkinter window, so the function takes the table as a parameter and returns the specific table that was updated by the user in the pandastable interface.
Like I mentioned, it runs before the window is set up and then does not run again when the button is clicked, so I don't even know if it works to save data once outliers are removed by the user.