Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pd.crosstab(index = titanic.sex, columns = titanic.pclass, values=titanic.age, aggfunc="mean")
- titanic.pivot_table(index = "sex", columns = "pclass", values = "age", aggfunc = "mean")
- titanic.groupby(["sex", "pclass"]).age.mean().unstack()
- titanic.groupby(["sex", "age"], as_index = False).mean()
- ####################################################################################################
- pd.crosstab(index = [summer.Year, summer.Country], columns = summer.Medal, aggfunc = "count",
- values = summer.Athlete, margins = True).fillna(0)
- summer.pivot_table(index=["Year", "Country"], columns = "Medal", aggfunc = "count",
- values = "Athlete", fill_value=0, margins = True)
- summer.groupby(["Year", "Country", "Medal"]).Medal.count().unstack(fill_value = 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement