I'm trying to import a CSV file of my choice (by selecting it) but in python's csv libraries I can't find a function that allows me to open a choice path without having to go through pyton's prompt. Has anyone managed to open a Windows window for file selection? Thx
Asked
Active
Viewed 70 times
0
-
first you want to have a window to select a file, you should use tkinter to be able to do that check here [https://stackoverflow.com/questions/3579568/choosing-a-file-in-python-with-simple-dialog] then use pandas to open it – Walid Bousseta Jun 24 '21 at 13:44
1 Answers
2
import pandas as pd
file = pd.read_csv('path to your file', sep='your separator')

mohamed lamnouar
- 29
- 1
- 4