1

guys i have been trying to load some datasets from kaggle which has been downloaded already.

hist_trans = pd.read_csv('historical_transactions.csv')

new_trans = pd.read_csv('new_merchant_transactions.csv')


train = pd.read_csv('train.csv', parse_dates=['first_active_month'])

test = pd.read_csv('test.csv', parse_dates=['first_active_month'])

And i had this error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte

Agboola Lucas
  • 11
  • 1
  • 5
  • have you tried a different encoding? the `read_csv` method taks as param `encoding =[ ]` try `encoding = 'ISO-8859-1'`. it might help – The BrownBatman Dec 03 '18 at 11:30

1 Answers1

5

Try encoding option in read_csv like below.

read_csv('file', encoding = "utf-8")

or

read_csv('file', encoding = "ISO-8859-1")
LOrD_ARaGOrN
  • 3,884
  • 3
  • 27
  • 49