UnicodeDecodeError: "utf-8" codec can"t decode byte 0xeb in position 8: unexpected end of data

0 votes
country= pd.read_csv("C:\\Edureka\\Python\\02_toupload\\worldcities.csv",index_col = 0)

Giving me 

UnicodeDecodeError: "utf-8" codec can"t decode byte 0xeb in position 8: unexpected end of data

How to fix this?

Jul 15, 2019 in Python by Reena
2,045 views

1 answer to this question.

0 votes

To read this dataset use encoding as latin1 below is the reference you can use:

data=ps.read_csv(r"C:\Users\akashkumar\Downloads\02_toupload_wub8x\02_toupload\worldcities.csv",encoding='latin1')
answered Jul 15, 2019 by Rishi

Thanks, its helpful to use

encoding='latin1'

Related Questions In Python

0 votes
0 answers

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

my code import wordcloud import numpy as np from matplotlib ...READ MORE

6 days ago in Python by anonymous
• 120 points
99 views
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
416 views
0 votes
1 answer

What are the different types of data types one can use in Python?

Python provides an array of built-in constants, ...READ MORE

answered May 28, 2019 in Python by Harsh
• 260 points
67 views
+1 vote
1 answer

(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

You are getting this error because you ...READ MORE

answered Dec 31, 2019 in Python by Kalgi
• 51,830 points
2,510 views
0 votes
1 answer
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 763 views
0 votes
0 answers
+4 votes
6 answers
+1 vote
1 answer
+1 vote
1 answer

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

You have to use the encoding as latin1 ...READ MORE

answered Jul 23, 2019 in Python by Kunal
18,441 views