Aug-12-2023, 05:58 AM
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
[attachment=2491]
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)
---------------------------------------------------------------------------
[attachment=2492]
How can i solve the directory problem?
Thanks in advance
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
[attachment=2491]
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)
---------------------------------------------------------------------------
[attachment=2492]
How can i solve the directory problem?
Thanks in advance