Lily Draklellis
Lily Draklellis

Reputation: 1

Pandas CSV Import failing?

I know this should be the easiest thing to do... but I can't figure it out! I'm simply trying to open a file

df1 = pd.read_csv(r'C:\Users\erifilidraklellis\Desktop\In It Together\Excel\CSV\ii2g.csv')

but I keep getting the error

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\erifilidraklellis\\Desktop\\In It Together\\Excel\\CSV\\ii2g.csv'

Both the file I'm trying to open and the jupyter notebook are currently living in the same folder. Please help!

Upvotes: 0

Views: 89

Answers (2)

Vidya Ganesh
Vidya Ganesh

Reputation: 818

Apparently \In It Together\ has spaces which are not being handled. Try changing the name of the file. You could also refer to the sep section from Pandas Doc

Upvotes: 0

Ossi H.
Ossi H.

Reputation: 84

You mentioned that the files are in the same folder. Have you tried using a relative path ?

pd.read_csv('ii2g.csv')

or

pd.read_csv('./ii2g.csv')

If you have tried these options, maybe this question posted by Impuls3H issue; pandas.read_csv File Not Found Error will be of use.

Upvotes: 2

Related Questions