I'm getting the following error when executing my script which analyses text from a csv file.
The sentence contains German characters such as é and ü. It looks like Python is falling over on these characters. I've tried changing from ascii to utf-8 encoding but this hasn't really helped.
My Python script:
import csv
from textblob import TextBlob
infile = 'C:\Python27\file.csv'
with open(infile, 'rb') as csvfile:
rows = csv.reader(csvfile)
for row in rows:
sentence = row[4]
blob = TextBlob(sentence)
print sentence
print blob.sentiment.polarity, blob.sentiment.subjectivity
(Also if someone can explain how to output the results into a csv file, would be very much appreciated.)