title: How to encode words in a list in Python
body: <p>I have a dictionary where I have each word as a key and a corresponding integer value, such as : </p>
  
  <pre><code> {'me': 41, 'are': 21, 'the': 0}
  </code></pre>
  
  <p>I have a data frame with a column of lists of words that are already tokenized, such as :</p>
  
  <pre><code>['I', 'liked', 'the', 'color', 'of', 'this', 'top']
  ['Just', 'grabbed', 'this', 'today', 'great', 'find']
  </code></pre>
  
  <p>How can I encode each of these words into their corresponding values from the dictionary. For example:</p>
  
  <pre><code>[56, 78, 5, 1197, 556, 991, 40] 
  </code></pre>