Answers for "fill misssing values using sklrean"

0

fill misssing values using sklrean

import numpy as np
from sklearn.impute import SimpleImputer
imp = SimpleImputer(missing_values=np.nan, strategy='mean')
imp.fit([[1, 2], [np.nan, 3], [7, 6]])

X = [[np.nan, 2], [6, np.nan], [7, 6]]
print(imp.transform(X))
Posted by: Guest on April-06-2021

Code answers related to "fill misssing values using sklrean"

Python Answers by Framework

Browse Popular Code Answers by Language