Last active
May 31, 2018 15:38
-
-
Save sananand007/7c600f884a9ffc66bfff89f8e02cfb35 to your computer and use it in GitHub Desktop.
Kaggle Titanic Dataset [on Medium]
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
# Now to fill up the NA values for Ages | |
mean_age=df_train_filt2['Age'].mean() | |
listofAgeind_=list(df_train_filt2[df_train_filt2['Age'].isna()==True].index) | |
list_of_ages=np.random.normal(mean_age, 10, len(listofAgeind_)) | |
plt.plot(list_of_ages, linewidth=2, color='g', label='Age') | |
plt.show() | |
for (idx,age) in zip(listofAgeind_,list_of_ages):df_train_filt2.loc[idx, 'Age']=age | |
print(df_train_filt2.count()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment