Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 16, 2020 18:54
Show Gist options
  • Save aniruddha27/bd617493fd9d1bce1a06006db133277b to your computer and use it in GitHub Desktop.
Save aniruddha27/bd617493fd9d1bce1a06006db133277b to your computer and use it in GitHub Desktop.
#handling null values
table = pd.pivot_table(df,index=['Sex','Survived','Pclass'],columns=['Embarked'],values=['Age'],aggfunc=np.mean,fill_value=np.mean(df['Age']))
table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment