0

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?

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

4 Comments

I've just tried to open it in Google Chrome. Neverthless, when I put in the whole path into my jupyter notebook (incl. my user home), it doesn't work.
I would double, trouble check if the path is correct, on the cli.
ok, do you run the jupiter notebook yourself or is it some sort of online thing ?
I checked the path sever times. I copied it. I run jupyter notebook locally. I've found out that people with macbooks do often have trouble with this and use git or something to solve the issue. But J....this is so crazy and it must works otherwise!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.