I am trying to go through a list of comments collected on a pandas dataframe and tokenize those words and put those words in a new column in the dataframe but I have having an error running through this, is
The error is stating that AttributeError: 'unicode' object has no attribute 'apwords'
Is there any other way to do this? Thanks
def apwords(words):
filtered_sentence = []
words = word_tokenize(words)
for w in words:
filtered_sentence.append(w)
return filtered_sentence
addwords = lambda x: x.apwords()
df['words'] = df['complaint'].apply(addwords)
print df