Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import io
- import webbrowser
- import tkinter as tk
- from tkinter import filedialog
- import seaborn as sb
- root= tk.Tk()
- canvas1 = tk.Canvas(root, width = 300, height = 300, bg = 'lightsteelblue2', relief = 'raised')
- canvas1.pack()
- def getCSV ():
- global df
- filepath = filedialog.askopenfilename()
- data = pd.read_csv(filepath)
- df = pd.DataFrame(data, columns=['Name', 'Age', 'Nationality', 'Club', 'Release Clause', 'Overall'])
- df2 = pd.DataFrame(data, columns=['Overall'])
- #df = data
- #print (df)
- html = df.to_html()
- text_file = io.open("index.html", "w", encoding="utf-8")
- text_file.write(html)
- text_file.close()
- webbrowser.open('index.html')
- print(type(data))
- sb.distplot(df2)
- importGUI = tk.Button(text="Import CSV File", command=getCSV, bg='white', fg='black', font=('youtube-sans-light', 16))
- canvas1.create_window(150, 150, window=importGUI)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement