title: Python: How to add list of tokens to new column of dataframe
body: <p>I have a large dataframe with over 50 rows. For each row I have a column 'tokens', this contains a large number of textual tokens. I have used a for-loop along with frequency distribution to find the top-10 tokens in each row for the 'tokens' column. </p>
  
  <p>I am trying to add a new column to my dataframe called 'top10', so that for each row, the top-10 tokens are contained in the 'top10' column. </p>
  
  <p>This is the current code I am using to find my top-10 tokens for each row. </p>
  
  <pre><code>for i in range(len(df)):
     tokens = df.iloc[i]['tokens']
     frequency = nltk.FreqDist(tokens)
     print(" ", word_frequency.most_common(10))
  </code></pre>
  
  <p>A sample of my dataframe:</p>
  
  <pre><code>id location about age tokens
  1    usa     ...  20   ['jim','hi','hello'......]
  ...
  ... 
  40    uk     ...  50   ['bobby','hi','hey'......]
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>id location about age tokens                           top10
  1    usa     ...  20   ['jim','hi','hello'......]   ['hi', 'paddy'....]
  ...
  ... 
  40    uk     ...  50   ['bobby','hi','hey'......]   ['john', 'python'..]
  </code></pre>
  
  <p>The top10 column should display words in descending order. </p>
  
  <p>Any help is appreciated, thank you!</p>