Skip to content

Instantly share code, notes, and snippets.

@DiogoRibeiro7
Created April 15, 2019 17:36
Show Gist options
  • Save DiogoRibeiro7/3fed040992c375403d33d17b8bda7792 to your computer and use it in GitHub Desktop.
Save DiogoRibeiro7/3fed040992c375403d33d17b8bda7792 to your computer and use it in GitHub Desktop.
group_by_age = pd.cut(titanic_df["age"], np.arange(0, 90, 10))
age_grouping = titanic_df.groupby(group_by_age).mean()
age_grouping['survived'].plot.bar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment