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
997 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

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
262 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
50 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,110 points
392 views
+2 votes
2 answers

In a list of dictionaries, how can I find the minimum calue in a common dictionary field.

There are several options. Here is a ...READ MORE

answered Apr 10, 2018 in Python by charlie_brown
• 7,740 points
114 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 550 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
7,024 views