'utf-8' codec can't decode byte 0xa0 in position 4276: invalid start byte

前端 未结 4 650
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 07:54

I try to read and print the following file: txt.tsv (https://www.sec.gov/files/dera/data/financial-statement-and-notes-data-sets/2017q3_notes.zip)

According to the S

相关标签:
4条回答
  • 2020-12-05 08:24

    i have the same error message for .csv file, and This Worked for me :

         df = pd.read_csv('Text.csv',encoding='ANSI')
    
    0 讨论(0)
  • 2020-12-05 08:26

    If someone works on Turkish data, then I suggest this line:

    df = pd.read_csv("text.txt",encoding='windows-1254')
    
    0 讨论(0)
  • 2020-12-05 08:44
    ds = pd.read_csv('/Dataset/test.csv', encoding='windows-1252') 
    

    Works fine for me, thanks.

    0 讨论(0)
  • 2020-12-05 08:50

    Encoding in the file is 'windows-1252'. Use:

    open('txt.tsv', encoding='windows-1252')
    
    0 讨论(0)
提交回复
热议问题