0

I have a CSV file that looks like this in excel. I tried to get the data from this csv file. However, it will give me an error saying UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 15-16: invalid continuation byte. I tried to search it up online but couldn't find a solution for it. I've attached my code as well.

enter image description here

filename = "try.csv"
with open(filename,"r") as filedata:
  csv_reader = reader(filedata)
  print(csv_reader)
  header = next(csv_reader)
  temp = []
  for sp in csv_reader:
    temp.append(sp[0])
print(temp)
Ray
  • 1
  • Please [don’t post images of code, error messages, or other textual data.](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557) We need to see the actual data you are trying to read, probably as a hex dump of the first twenty or so bytes. With the amount of information you have provided, all we can tell you is what's already in the error message; your input data isn't valid UTF-8, but Pyhon can't guess the correct encoding, and nor can we without more details. – tripleee Apr 13 '22 at 02:34

0 Answers0