Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Error in Code || Python(Spyder 3.6)

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles