title: TypeError: ufunc 'isnan' not supported for the input types, Using Imputer for NaN values
body: <p>I'm a newbie in python and pandas . I'm trying to preprocess a big dataframe which consists of both numerical and categorical features and in some columns there are NaN values . 
  first I try to get the feature matrix and then use Imputer to put the mean or median value for Nan values . </p>
  
  <p>this is the dataframe </p>
  
  <pre><code>    MSSubClass MSZoning  LotFrontage  LotArea Street LotShape LandContour  \
  0             60       RL         65.0     8450   Pave      Reg         Lvl   
  1             20       RL         80.0     9600   Pave      Reg         Lvl   
  2             60       RL         68.0    11250   Pave      IR1         Lvl   
  3             70       RL         60.0     9550   Pave      IR1         Lvl   
  4             60       RL         84.0    14260   Pave      IR1         Lvl   
  5             50       RL         85.0    14115   Pave      IR1         Lvl   
  6             20       RL         75.0    10084   Pave      Reg         Lvl   
  7             60       RL          NaN    10382   Pave      IR1         Lvl   
  8             50       RM         51.0     6120   Pave      Reg         Lvl   
  9            190       RL         50.0     7420   Pave      Reg         Lvl   
  10            20       RL         70.0    11200   Pave      Reg         Lvl   
  11            60       RL         85.0    11924   Pave      IR1         Lvl
  </code></pre>
  
  <p>code : just to change the Nan values in LotFrontage (index number = 2) to mean value of the column  </p>
  
  <pre><code>imputer = Imputer(missing_values='Nan',strategy="mean",axis=0)
  features = reduced_data.iloc[:,:-1].values
  imputer.fit(features[:,2])
  </code></pre>
  
  <p>when I run this , an error occurs which says : </p>
  
  <pre><code>TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''    
  </code></pre>
  
  <p>first : Is my approach correct ? 
  second : How to handle the Error ? </p>
  
  <p>thanks </p>