I am trying to let user choose desired number of inputs from an imported cvs file, and assign it as inputs of a machine learning. Can someone please help me? I do not know tkinter and how I can convert df['input1'] to something that is OK for tkinter envirenmot. Many Thanks

import tkinter as tk

from tkinter.filedialog import askopenfilename

import pandas as pd

def import_csv_data():
    global v
    csv_file_path = askopenfilename()
    df = pd.read_csv(csv_file_path)

root = tk.Tk()

tk.Label(root, text='File Path').grid(row=0, column=0)
v = tk.StringVar()
entry = tk.Entry(root, textvariable=v).grid(row=0, column=1)
tk.Button(root, text='BrowseDataSet',command=import_csv_data).grid(row=1, column=0)
tk.Button(root, text='Close',command=root.destroy).grid(row=1, column=1)


#What to write here to let user choose desired inputs to be assigned to:

X= User checkbox by Tkinter
#then goes for machine learning part

0 Answers