I switched this simply by defining a different codec package in the read_csv() command:
encoding = 'unicode_escape'
import pandas as pddata = pd.read_csv(filename, encoding= 'unicode_escape')
Try the below code snippet:
with open(path, 'rb') as f: text = f.read()
The error is because there is some non-ascii character in the dictionary and it can't be encoded/decoded. One simple way to avoid this error is to encode such strings with encode() function as follows (if a is the string with non-ascii character):