2
我試圖來標記一些文件,但我有這個錯誤蟒蛇符號化的UnicodeDecodeError
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 6: ordinal not in range(128)
import nltk
import pandas as pd
df = pd.DataFrame(pd.read_csv('status2.csv'))
documents = df['status']
result = [nltk.word_tokenize(sent) for sent in documents]
我認爲這是unicode的問題,所以我說
documents = unicode(documents, 'utf-8')
另一個錯誤
TypeError: coercing to Unicode: need string or buffer, Series found
print documents
1 Brandon Cachia ,All I know is that,you're so n...
2 Melissa Zejtunija:HAM AND CHEESE BIEX INI??? *...
3 .........Where is my mind?????
4 Having a philosophical discussion with Trudy D...