Reputation: 11
So, here's my code...
filename = r"C:\Users\Aditya Bhatt\Desktop\Aditya\SampleData.csv"
df = pd.read_csv(filename)
Now, it shows me this error:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Aditya Bhatt\Desktop\Aditya\SampleData.csv'
The file location is: "C:\Users\Aditya Bhatt\Desktop\Aditya"[Confirmed]
Name of File: SampleData (.csv file)
I'm running the code on Google Colab
Also, I got this file from the internet (If that helps)
Upvotes: 0
Views: 3404
Reputation: 321
you have to put double back slashes \\
instead of single \
so it should be like this:
C:\something\assd\dada\x.csv
Upvotes: 1
Reputation: 56
here you go. How to deal with local files in Google Colab
Since a Colab notebook is hosted on Google’s cloud servers, there’s no direct access to files on your local drive (unlike a notebook hosted on your machine) or any other environment by default.
Upvotes: 0