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

前端 未结 13 1285
南笙
南笙 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条回答
  •  借酒劲吻你
    2020-12-15 20:58

    Try using os.path.join to create the filepath:

    import os
    f_path = os.path.join(*['C:', 'Users', 'user', 'Desktop', 'datafile.csv'])
    df = pd.read_csv(f_path)
    

提交回复
热议问题