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
32,885 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

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

Thanks, This answer was helpful. READ MORE

answered Jul 11, 2020 in Python by Prashant Chhatrashali
16,735 views
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, 2020 in Python by Niroj
• 82,880 points
17,548 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, 2020 in Python by Gitika
• 65,890 points
24,877 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, 2020 in Python by anonymous
• 120 points
5,235 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

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

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,006 views
+5 votes
4 answers
+3 votes
2 answers

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
247,471 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP