title: Filling a column of a CSV file with a value in python
body: <p>I have a CSV file where in the 'Gender' column some of the fields are missing. So I  need to autofill them using the fillna() function using python. I am giving a condition that if the ApplicantIncome is greater than 20000, then the fields must be updated with the 'Male' tag in 'Gender' column. The code for the same is pasted below and also the error associated with that error. So, can anyone please help me out in solving the error</p>
  
  <blockquote>
    <p>if data['ApplicantIncome'] >= 20000:
        data['Gender'].fillna(data['Gender'] == 'Male',inplace=True)</p>
  </blockquote>
  
  <p>The error is as below:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-97-19fee6c4a819&gt; in &lt;module&gt;
  ----&gt; 1 if data['ApplicantIncome'] &gt;= 20000:
        2     data['Gender'].fillna(data['Gender'] == 'Male',inplace=True)
  
  ~\Anaconda3\lib\site-packages\pandas\core\generic.py in __nonzero__(self)
     1574         raise ValueError("The truth value of a {0} is ambiguous. "
     1575                          "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
  -&gt; 1576                          .format(self.__class__.__name__))
     1577 
     1578     __bool__ = __nonzero__
  
  ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>