Tokenizing words into a new column in a pandas dataframe
<p>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 </p>

<p>The error is stating that AttributeError: 'unicode' object has no attribute 'apwords'</p>

<p>Is there any other way to do this? Thanks</p>

<pre><code>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
</code></pre>