0 votes
1 view
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 (40.7k points)

Here, simply use tkinter.

Code:

from tkinter import *

frome tkinter.filedialog import askopenfilename

import pandas as pd

Tk().withdraw()

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

file = askopenfilename()

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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...