Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help - FileNotFound
#1
Hi all,

I am a new learner of python so forgive if my question is too rookie. I am using Colab to start learning. I have a csv file on my desktop folder. When I need to read the file, the problem is that the directory is incorrect. I googled many solutions but they did not work for my case at all.

Here is the directory of my file: C:\Users\USER\Desktop\Learning\GrandmaCan
File name is: Salary_Data.csv
   

The error on Colab is as follows:

---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-14-2ff469c75df4> in <cell line: 3>()
1 import pandas as pd
2
----> 3 data = pd.read_csv(r'C:\Users\USER\Desktop\Learning\GrandmaCan\Salary_Data.csv')
4
5 print(data)
---------------------------------------------------------------------------

I tried to modify my code but there is another error:

---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-15-f144dd2c210b> in <cell line: 3>()
1 import pandas as pd
2
----> 3 data = pd.read_csv('C:\\Users\\USER\\Desktop\\Learning\\GrandmaCan\\Salary_Data.csv')
4
5 print(data)
---------------------------------------------------------------------------
   

How can i solve the directory problem?
Thanks in advance
Reply


Messages In This Thread
Help - FileNotFound - by SmallGuy - Aug-12-2023, 05:58 AM
RE: Help - FileNotFound - by SpongeB0B - Aug-12-2023, 06:30 AM
RE: Help - FileNotFound - by SmallGuy - Aug-12-2023, 08:10 AM
RE: Help - FileNotFound - by snippsat - Aug-12-2023, 09:24 AM
RE: Help - FileNotFound - by perfringo - Aug-12-2023, 09:27 AM
RE: Help - FileNotFound - by SmallGuy - Aug-12-2023, 09:47 AM
RE: Help - FileNotFound - by snippsat - Aug-12-2023, 10:18 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020