From 13202dc1a51bcbda08fd0a5ac31f09b40c647c4a Mon Sep 17 00:00:00 2001 From: Sanwal Yousaf Date: Wed, 6 Mar 2019 07:18:29 -0500 Subject: [PATCH] added encoding The csv file needs to be opened with read(not binary) privileges. The value of encoding to use for opening this file is 'cp1252' on line 18. This change is based on my implementation in python 3.6+ --- process_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_data.py b/process_data.py index c5ab027..b8479e7 100644 --- a/process_data.py +++ b/process_data.py @@ -15,7 +15,7 @@ def build_data_cv(datafile, cv=10, clean_string=True): revs = [] vocab = defaultdict(float) - with open(datafile, "rb") as csvf: + with open(datafile, "r", encoding = 'cp1252') as csvf: csvreader=csv.reader(csvf,delimiter=',',quotechar='"') first_line=True for line in csvreader: