UnicodeDecodeError when reading CSV file in Pandas with Python

后端 未结 21 2216
野趣味
野趣味 2020-11-22 04:27

I\'m running a program which is processing 30,000 similar files. A random number of them are stopping and producing this error...

File "C:\\Importer\\src         


        
21条回答
  •  旧巷少年郎
    2020-11-22 04:45

    with open('filename.csv') as f:
       print(f)
    

    after executing this code you will find encoding of 'filename.csv' then execute code as following

    data=pd.read_csv('filename.csv', encoding="encoding as you found earlier"
    

    there you go

提交回复
热议问题