Last active
May 31, 2022 11:06
-
-
Save rkdgusrn1212/ffefda40ee59933975113f25e79b00f8 to your computer and use it in GitHub Desktop.
Missing Values : 2) Imputation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from sklearn.impute import SimpleImputer | |
data = pd.DataFrame() | |
imputer = SimpleImputer() | |
imputed_data = pd.DataFrame(imputer.fit_transform(data)) #imputed 된 dataframe, column이름도 index로 치환됨... | |
imputed_data.columns = data.columns #바뀐 column이름들 다시 넣어주기 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment