title: How set values in pandas dataframe based on NaN values of another column?
body: <p>I have dataframe named <code>df</code> with original shape <code>(4361, 15)</code>. Some of <code>agefm</code> column`s values are NaN.  Just look: </p>
  
  <pre><code>&gt; df[df.agefm.isnull() == True].agefm.shape
  (2282,)
  </code></pre>
  
  <p>Then I create new column and set all its values to 0: </p>
  
  <pre><code>df['nevermarr'] = 0
  </code></pre>
  
  <p>So I would like to set <code>nevermarr</code> value to 1, then in that row <code>agefm</code> is Nan:</p>
  
  <pre><code>df[df.agefm.isnull() == True].nevermarr = 1
  </code></pre>
  
  <p>Nothing changed:</p>
  
  <pre><code>&gt; df['nevermarr'].sum()
  0
  </code></pre>
  
  <p>What am I doing wrong?</p>