title: "None of [Float64Index([nan, nan], dtype='float64')] are in the [index]" setting col A value if col B contains string
body: <p>I have a dataframe (called <code>corpus</code>) with one column (<code>tweet</code>) and 2 rows:</p>
  
  <pre><code>['check, tihs, out, this, bear, love, jumping, on, this, plant']
  ['i, can, t, bear, the, noise, from, that, power, plant, it, make, me, jump']
  </code></pre>
  
  <p>I have a list (called <code>vocab</code>) of unique words in the column:</p>
  
  <pre><code>['check',
   'tihs',
   'out',
   'this',
   'bear',
   'love',
   'jumping',
   'on',
   'plant',
   'i',
   'can',
   't',
   'the',
   'noise',
   'from',
   'that',
   'power',
   'it',
   'make',
   'me',
   'jump']
  </code></pre>
  
  <p>I want to add a new column for each word in vocab. I want all values for the new columns to be zero, except for when the <code>tweet</code> contains the word, in which case I want the value of the word column to be 1.</p>
  
  <p>So I tried running the code below:</p>
  
  <pre><code>for word in vocab:
      corpus[word] = 0
      corpus.loc[corpus["tweet"].str.contains(word), word] = 1
  </code></pre>
  
  <p>...and the following error was displayed:</p>
  
  <pre><code>"None of [Float64Index([nan, nan], dtype='float64')] are in the [index]"
  </code></pre>
  
  <p>How can I check to see if the tweet contains the word, and then if so, set the value of the new column for the word to 1?</p>