UnicodeDecodeError: "utf-8" codec can't decode byte in position : invalid start byte

0 votes

While I importing the file it shows

UnicodeDecodeError: "utf-8" codec can"t decode byte 0xa0 in position 10: invalid start byte


import pandas as pd
a = pd.read_csv("filename.csv")
Jul 23 in Python by Hari

1 answer to this question.

0 votes

You have to use the encoding as latin1 to read this file as there are some special character in this file, use the below code snippet to read the file,

import pandas as pd


answered Jul 23 by Kunal

Related Questions In Python

0 votes
2 answers

Error: Speech to Text Codec cannot decode the bytes in position

import speech_recognition as sr r = sr.Recognizer() audio ='C\Users\Desktop\audiofile1.wav' with ...READ MORE

answered Nov 27, 2018 in Python by Nabarupa Das
0 votes
2 answers

Python Error "UnicodeEncodeError: 'ascii' codec can't encode character u'\u03b1' in position 20: ordinal not in range(128)"

import csv import sys reload(sys) sys.setdefaultencoding('utf8') data = [["a", "b", u'\xe9']] with ...READ MORE

answered Jun 28 in Python by anonymous
0 votes
1 answer

Writing unit tests in Python: How do I start?

If you're brand new to using unittests, ...READ MORE

answered Sep 18, 2018 in Python by Priyaj
• 56,520 points
0 votes
1 answer

Can't Click an Element in Python Selenium After Successfully Finding It

I've encountered this problem of not being ...READ MORE

answered Oct 4, 2018 in Python by Priyaj
• 56,520 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 222 views
+4 votes
6 answers