Reputation: 63
I am really beginning at python, but I am hours in this line, can't go anywhere without fixing it.
cadastro_2019_10= pd.read_csv("inf_cadastral_fi_20191015.csv",delimiter=";")[["CNPJ_FUNDO","DENOM_SOCIAL","CLASSE"]]
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 49: invalid continuation byte
cadastro_2019_10= pd.read_csv("inf_cadastral_fi_20191015.csv",delimiter=";")[["CNPJ_FUNDO","DENOM_SOCIAL","CLASSE"]]
again:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 388: invalid continuation byte
Upvotes: 3
Views: 3732
Reputation: 63
I found that I had to add :encoding='cp1252' but thank you for your time
Upvotes: 1
Reputation: 11368
Figure out what encoding the CSV file uses. Seems it doesn't use UTF-8. Say it's latin1, then you can try with read_csv(..., encoding="latin1")
.
If you are on a UNIX system, you can use the file
command to try to detect the encoding.
Upvotes: 1