Skip to content Skip to sidebar Skip to footer

Why Does Pandas Read_csv Have Unicode Error When Encoding Utf-8 Is Specified?

When executing the following Python 3.6 code in Jupyter 5.000 notebook: import pandas as pd file = 'C:\users\frogf\MSDS7333\data\HIGGS.csv' data=pd.read_csv(file,nrows=N,header=Non

Solution 1:

open the file as raw string. Try:

import pandas as pd
data=pd.read_csv(r"C:\users\frogf\MSDS7333\data\HIGGS.csv",nrows=10,header=None,encoding = "utf-8")

Post a Comment for "Why Does Pandas Read_csv Have Unicode Error When Encoding Utf-8 Is Specified?"