title: Imputer mean strategy removes NaN instead of replacing
body: <p>I am trying to replace NaN values in a given dataset by the column mean using <code>sklearn.preprocessing.Imputer</code>. Instead of having <code>NaN</code> replaced I instead find that they are being removed by my code. Here is a short example demonstrating this issue I am facing:</p>
  
  <pre><code>&gt;&gt;&gt; test_data = np.array([float("NaN"), 1, 2, 3])
  &gt;&gt;&gt; imp = Imputer(missing_values=float("NaN"), strategy="mean")
  &gt;&gt;&gt; imp.fit_transform(test_data)
  ** Deprecation warning truncated **
  array([[1., 2., 3.]])
  </code></pre>
  
  <p>What should I change so that instead of removing the <code>NaN</code> it gets replaced by <code>2.</code> ? </p>
  
  <p>I tried to adapt from the <code>sklearn.preprocessing.Imputer</code> <a href="http://scikit-learn.org/stable/modules/preprocessing.html#imputation" rel="nofollow noreferrer">user guide</a> and was originally following <a href="https://stackoverflow.com/questions/30317119/classifiers-in-scikit-learn-that-handle-nan-null">this answer</a> but I must have misunderstood them.</p>
  
  <p>Edit:</p>
  
  <p>I have also tried the following, which gets rid of the deprecation warning but does not change the end result:</p>
  
  <pre><code>&gt;&gt;&gt; test_data = np.array([[float("NaN"), 1, 2, 3]])
  &gt;&gt;&gt; imp = Imputer(missing_values=float("NaN"), strategy="mean")
  &gt;&gt;&gt; imp.fit_transform(test_data)
  array([[1., 2., 3.]])
  </code></pre>