# -*- coding = utf-8 -*-
# @Time : 2021/11/27 12:16
# @Author : NKY
# @File : repalce.py
# @Sofeware : PyCharm
import numpy as np
from sklearn.impute import SimpleImputer
import pandas as pd
# data_url = "diabetes.csv"
# df = pd.read_csv(data_url)
imp = SimpleImputer(missing_values=np.nan,strategy='mean')
imp.fit([[1,2],[np.nan,3],[7,6]])
# imp.fit(df)
X = [[np.nan,2],[6,np.nan],[7,6]]
# print(imp.transform(df))
print(imp.transform(X))