title: Python - SkLearn Imputer usage
body: <p>I have the following question: I have a pandas dataframe, in which missing values are marked by the string <code>na</code>. I want to run an Imputer on it to replace the missing values with the mean in the column. According to the sklearn documentation, the parameter <code>missing_values</code> should help me with this:</p>
  
  <blockquote>
    <p>missing_values : integer or “NaN”, optional (default=”NaN”) The
    placeholder for the missing values. All occurrences of missing_values
    will be imputed. For missing values encoded as np.nan, use the string
    value “NaN”.</p>
  </blockquote>
  
  <p>In my understanding, this means, that if I write</p>
  
  <pre><code>df = pd.read_csv(filename)
  imp = Imputer(missing_values='na')
  imp.fit_transform(df)
  </code></pre>
  
  <p>that would mean that the imputer replaces anything in the dataframe with the <code>na</code> value with the mean of the column. However, instead, I get an error:</p>
  
  <pre><code>ValueError: could not convert string to float: na
  </code></pre>
  
  <p>What am I misinterpreting? Is this not how the imputer should work? How can I replace the <code>na</code> strings with the mean, then? Should I just use a lambda for it?</p>
  
  <p>Thank you!</p>