UnicodeDecodeError when reading CSV file in Pandas with Python

后端 未结 21 2264
野趣味
野趣味 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 05:02

    In my case this worked for python 2.7:

    data = read_csv(filename, encoding = "ISO-8859-1", dtype={'name_of_colum': unicode}, low_memory=False) 
    

    And for python 3, only:

    data = read_csv(filename, encoding = "ISO-8859-1", low_memory=False) 
    

提交回复
热议问题