pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa' despite correct path

前端 未结 13 1301
南笙
南笙 2020-12-15 20:14

I\'m trying to load a .csv file using the pd.read_csv() function when I get an error despite the file path being correct and using raw strings.

13条回答
  •  猫巷女王i
    2020-12-15 21:10

    I was trying to read the csv file from the folder that was in my 'c:\'drive but, it raises the error of escape,type error, unicode......as such but this code works just take an variable then add r to read it.

    rank = pd.read_csv (r'C:\Users\DELL\Desktop\datasets\iris.csv') 
    df=pd.DataFrame(rank)
    

提交回复
热议问题