“CSV file does not exist” for a filename with embedded quotes

前端 未结 18 793
萌比男神i
萌比男神i 2020-12-15 23:16

I am currently learning Pandas for data analysis and having some issues reading a csv file in Atom editor.

When I am running the following code:

imp         


        
18条回答
  •  佛祖请我去吃肉
    2020-12-15 23:56

    Just referring to the filename like

    df = pd.read_csv("FBI-CRIME11.csv")
    

    generally only works if the file is in the same directory as the script.

    If you are using windows, make sure you specify the path to the file as follows:

    PATH = "C:\\Users\\path\\to\\file.csv"
    

提交回复
热议问题