@ankz23 wrote:
I am getting an error by running the following code:
Code:
from sklearn.preprocessing import Imputer
imputer =Imputer(missing_values= ‘NAN’,strategy= ‘mean’,axis=0)Error:
File “C:\Users\Ankz\Anaconda3\lib\site-packages\sklearn\preprocessing\imputation.py”, 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?
Posts: 1
Participants: 1