title: Unable To work with the Sci-Kit Learn Catagorical Imputer
body: <p>I am unable to get the required result from the Sci-kit learn categorical Imputer.</p>
  <pre><code>df_cat = df[[&quot;Suburb&quot;, &quot;Address&quot;, &quot;Type&quot;, &quot;Method&quot;, &quot;SellerG&quot;, &quot;Date&quot;, &quot;YearBuilt&quot;, &quot;CouncilArea&quot;, &quot;Regionname&quot;]]
  
  df_cat['Suburb'] = pd.to_numeric(df_cat['Suburb'], errors='coerce')
  
  df_cat['Address'] = pd.to_numeric(df_cat['Address'], errors='coerce')
  
  df_cat['Type'] = pd.to_numeric(df_cat['Type'], errors='coerce')
  
  df_cat['Method'] = pd.to_numeric(df_cat['Method'], errors='coerce')
  
  df_cat['SellerG'] = pd.to_numeric(df_cat['SellerG'], errors='coerce')
  
  df_cat['YearBuilt'] = pd.to_numeric(df_cat['YearBuilt'], errors='coerce')
  
  df_cat['CouncilArea'] = pd.to_numeric(df_cat['CouncilArea'], errors='coerce')
  
  df_cat['Regionname'] = pd.to_numeric(df_cat['Regionname'], errors='coerce')
  
  df_cat['Date'] = pd.to_numeric(df_cat['Date'], errors='coerce')
  
  from sklearn.preprocessing import Imputer
  
  imputer2 = Imputer(strategy=&quot;most_frequent&quot;)
  
  imputer2.fit(df_cat)
  
  imputer2.statistics_
  </code></pre>
  <p>Result</p>
  <pre><code>array([     nan,      nan,      nan,      nan, 1.00e+00,      nan,
         1.97e+03,      nan,      nan])
  </code></pre>
  <p>The existing values are getting replaced by NaN. It is doing the exact opposite of my requirement.</p>