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 in Python by Reena
594 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 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
208 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 in Python by Harsh
• 260 points
40 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,720 points
90 views
0 votes
1 answer

How can I compare the content of two files in Python?

Assuming that your file unique.txt just contains ...READ MORE

answered Apr 16, 2018 in Python by charlie_brown
• 7,720 points
202 views
+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 420 views
+4 votes
6 answers
+1 vote
1 answer