Reputation: 485
I have a .csv file I want to load into pandas dataframe within the same folder as my project notebook. I'm using Mac OS a Jupyter Notebook. The file folder is:
/Documents/Notebooks/BM_Case/DrinkItems.csv
I've tried totally every possible path incl.:
drinks = pd.read_csv('/Users/Documents/Notebooks/BM_Case/DrinkItems.csv')
or
drinks = pd.read_csv('DrinkItems.csv')
but it always raises
FileNotFoundError: [Errno 2] File /Users/Documents/Notebooks/BM_Case/DrinkItems.csv does not exist: '/Users/Documents/Notebooks/BM_Case/DrinkItems.csv'
The .csv file is physically in the folder. What am I doing wrong?
Upvotes: 0
Views: 2496
Reputation: 2372
It looks like you have missed your user id from the full path
you can test the path in the cli
ls -lh /Users/Documents/Notebooks/BM_Case/DrinkItems.csv
ls -lh /Users/<your user home>/Documents/Notebooks/BM_Case/DrinkItems.csv
Upvotes: 1