Created
November 7, 2022 20:02
-
-
Save Emekaborisama/39e6161648cbf426132113b059a266dc to your computer and use it in GitHub Desktop.
handle missing values
This file contains 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
#handle missing values | |
from sklearn.impute import SimpleImputer | |
imp_ = SimpleImputer(missing_values=np.nan, strategy='most_frequent') | |
new_train_df = imp_.fit_transform(train_df) | |
new_train_df = pd.DataFrame(new_train_df, columns = train_df.columns) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment