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

前端 未结 13 1297
南笙
南笙 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 21:03

    For my particular issue, the failure to load the file correctly was due to an "invisible" character that was introduced when I copied the filepath from the security tab of the file properties in windows.

    This character is e2 80 aa, the UTF-8 encoding of U+202A, the left-to-right embedding symbol. It can be easily removed by erasing (hitting backspace or delete) when you've located the character (leftmost char in the string).

    Note: I chose to answer because the answers here do not answer my question and I believe a few folks (as seen in the comments) might meet the same situation as I did. There also seems to be new answers every now and then since I did not mark this question as resolved.

提交回复
热议问题