I'm trying to impute NaN values with SimpleImputer mean strategy but instead of imputing it, it deletes the NaN values, I read how to use it
here and the documentation, it simply does not work with numpy array or python lists, what's wrong? and what is the solution?
import numpy as np
from sklearn.impute import SimpleImputer
from sklearn.model_selection import train_test_split
X = np.array([[2,3,6,5,4, np.nan],[2,3,6,15,4, np.nan]])
SI = SimpleImputer(strategy='mean')
X = SI.fit_transform(X)
print(X)
output
runfile('D:/python projects/untitled0.py', wdir='D:/python projects')
[[ 2. 3. 6. 5. 4.]
[ 2. 3. 6. 15. 4.]]