Created
November 9, 2020 03:36
-
-
Save merishnaSuwal/e5660528d8adf0a59fcb511a8686ee2b to your computer and use it in GitHub Desktop.
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
# Replacing null values by mean | |
dataset['Age'].fillna(dataset['Age'].mean(), inplace = True) | |
dataset['T4U'].fillna(dataset['T4U'].mean(), inplace = True) | |
# Replacing null values by median | |
dataset['TSH'].fillna(dataset['TSH'].mean(), inplace = True) | |
dataset['T3'].fillna(dataset['T3'].median(), inplace = True) | |
dataset['TT4'].fillna(dataset['TT4'].median(), inplace = True) | |
dataset['FTI'].fillna(dataset['FTI'].median(), inplace = True) | |
# The gender data looks to be imbalanced with 0 lesser than 1 | |
# Replacing null values with 0 | |
dataset['Gender'].fillna(0, inplace = True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment