Reputation: 1
import pandas as pd
import os
df=pd.read_csv(r"C:/Users/tom/Desktop/misc/number-of-motor-vehicles-2018-census-csv.csv")
df
the above 4 lines are my code and im getting the error as shown below
FileNotFoundError: [Errno 2] File C:/Users/tom/Desktop/misc/number-of-motor-vehicles-2018-census-
csv.csv does not exist: 'C:/Users/tom/Desktop/misc/number-of-motor-vehicles-2018-census-csv.csv'
i tried removing "r" i tried front and back slash single and double quotes...plz help me out
Upvotes: 0
Views: 86
Reputation: 140
Have you made sure that the file does not have a second extension (possibly .txt)? This might happen when e.g. saving a file with Notepad and appending .csv
to the file name but disregarding the dropdown box "Save as type" ...
You could try
Dir C:\Users\tom\Desktop\misc\
os.listdir(r'C:\Users\Tobi\Desktop\misc')
in pythonUpvotes: 1