Skip to content

Instantly share code, notes, and snippets.

@hute37
Forked from aniruddha27/Pandas_6.py
Created June 15, 2020 09:11
Show Gist options
  • Save hute37/bbaffc5f62b3ab64ec183dc04d55d231 to your computer and use it in GitHub Desktop.
Save hute37/bbaffc5f62b3ab64ec183dc04d55d231 to your computer and use it in GitHub Desktop.
#different aggregate functions
table = pd.pivot_table(df,index=['Sex','Pclass'],aggfunc={'Age':np.mean,'Survived':np.sum})
table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment