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
6,489 views
thanks a lot, it helped

1 answer to this question.

+1 vote

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'
Thank u very much sir , It made my day .

Related Questions In Python

0 votes
2 answers
0 votes
1 answer

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

Hi, @hala, Regarding your query, you can go ...READ MORE

answered Jun 29 in Python by Niroj
• 56,800 points
1,167 views
0 votes
2 answers

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Hey,  @Himanshu. It's still most likely gzipped data. ...READ MORE

answered Jul 27 in Python by Gitika
• 36,530 points
376 views
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

Mar 29 in Python by anonymous
• 120 points
1,197 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,342 views
0 votes
0 answers
+4 votes
6 answers
+2 votes
1 answer
+2 votes
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
52,366 views