import pandas as pd data = pd.read_csv(filename, encoding= 'unicode_escape')
pd.read_csv('ml-100k/u.item', sep='|', names=m_cols , encoding='latin-1')
# Use 'ISO-8859-1' instead of "utf-8" for decoding text = open(fn, 'rb').read().decode('ISO-8859-1')
with open(file, newline='', encoding="utf16") as MyFile:
As suggested by Mark Ransom, I found the right encoding for that problem. The encoding was "ISO-8859-1", so replacing open("u.item", encoding="utf-8") with open('u.item', encoding = "ISO-8859-1") will solve the problem.
pd.read_csv("C:/Users/Admin/Desktop/Python/Past.csv",encoding='cp1252')
#use rb over r with open(path, 'rb') as f: text = f.read()