Error in Code || Python(Spyder 3.6)



I am getting an error by running the following code:


from sklearn.preprocessing import Imputer
imputer =Imputer(missing_values= 'NAN',strategy= 'mean',axis=0)


  File "C:\Users\Ankz\Anaconda3\lib\site-packages\sklearn\preprocessing\", line 29, in _get_mask
    if value_to_mask == "NaN" or np.isnan(value_to_mask):

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''

Can anyone tell what is wrong?