pandas: oserror with accent/special character in file path and file name

前端 未结 3 513
春和景丽
春和景丽 2020-12-22 05:25

I am trying to use pandas.read_csv to get data from some .csv files. This works fine as long as there is no accent (e.g. ä,é,ü) in the file name or file path. A

3条回答
  •  星月不相逢
    2020-12-22 06:06

    I tested the name in creating a fake file 'düm1.csv'.

    when I run :

    df = pd.read_csv('düm1.csv',sep=';')
    

    I haven't an OSError and the file is open in my Ipython.

       Unnamed: 0  test1  test2  test3  tes4
    0         NaN    1.0    2.0    3.0   4.0
    1         NaN    NaN    NaN    NaN   NaN
    2         NaN    NaN    NaN    NaN   NaN
    3         NaN    NaN    NaN    NaN   NaN
    4         NaN    NaN    NaN    NaN   NaN
    

    Have you tried without encoding ? Without accent ?

    C.

提交回复
热议问题