UnicodeDecodeError when reading CSV file in Pandas with Python

后端 未结 21 2223
野趣味
野趣味 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:04

    Try this:

    import pandas as pd
    with open('filename.csv') as f:
        data = pd.read_csv(f)
    

    Looks like it will take care of the encoding without explicitly expressing it through argument

提交回复
热议问题