import pandas as pd
import numpy as np

train = pd.read_csv ("../ C: \\ Users \\ Owner \\ Desktop/train.csv")
test = pd.read_csv ("../ C: \\ Users \\ Owner \\ Desktop/test.csv")

I am using windows.

I wrote the code as above to do kaggle, but unicode error is displayed.

How can I fix it?

  • Answer # 1

    A CSV file is a kind of basic text file
    When reading the file, if there is data that cannot be interpreted as characters (Unicode), the error will occur
    First, let's check what the character code of the file is.

    And specify the character code to open the file