Explore Courses Blog Tutorials Interview Questions
0 votes
in Data Science by (17.6k points)

I'm building a tool for the company where I work and I've built a program that returns different statistics from any csv file, of course with an specific data structure. Now, my issue is that I don't know how to do is to request the user to upload a file. In order to create this program I've been using as practice mode,

this: df = pd.read_csv('',delimiter=';', encoding='ISO-8859-1')

Any ideas?

1 Answer

0 votes
by (41.4k points)

Here, simply use tkinter.


from tkinter import *

frome tkinter.filedialog import askopenfilename

import pandas as pd


print("Please select a csv file to load") 

file = askopenfilename()

df = pd.read_csv(file, header = 0)

Browse Categories