user517696
user517696

Reputation: 2672

Error while importing a csv file

I tried importing a csv file using

import pandas as pd
df=pd.read_csv("samle.csv")

But there is an error while importing the file :

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

As i looked in the csv file, it had some characters like this: � How do i rectify this error?

Upvotes: 0

Views: 134

Answers (1)

zipa
zipa

Reputation: 27889

Did you try:

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

Upvotes: 1

Related Questions