0
I am trying to read a CSV file in Python using:
import csv
import json
arquivo = open('dados_teste.csv', encoding='utf8')
texto = arquivo.read()
resultado = json.loads(texto)
print (resultado)
But you’re making that mistake:
Unicodedecodeerror: 'utf-8' codec can’t Decode byte 0x85 in position 78: invalid start byte
The lines start with text or special characters, I did not understand why only at position 78 he gives this error and in all before it not.
Could you ask the question about the folder organization you have? The file name is exactly
teste
orteste.csv
?– Woss
If you have in windows, I think you have to 'test.csv'
– FourZeroFive
Thanks @Andersoncarloswoss the error was pq forgot to put . csv in the same name. But now gave another error that did not understand the reason, I edited the question.
– Pamela Matias
You are reading a file that does not have UTF-8 encoding as UTF-8. Check the encoding that was used when generating the file and also use it in reading.
– Woss
Got it, thanks! This base is a tool that does not give me any options when exporting, neither format nor see the coding of it. any hint of how I can get this data directly from excel?
– Pamela Matias