2

I am reading a csv file.

import pandas as pd

df = pd.read_csv("samplefile.csv",delimiter=',')

I got error as:

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

If I tried:

df = pd.read_csv("samplefile.csv",delimiter=',',encoding= 'unicode_escape')

Then, It works but I get unwanted characters like 'AÂ'

Also tried

 df = pd.read_csv("samplefile.csv",delimiter=',',encoding= 'ISO-8859-1')

same unwanted characters

1
  • have you tried df = pd.read_csv("samplefile.csv", encoding='utf-8'') Commented Jan 6, 2021 at 5:04

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.