I am working with the titanic survivors data set.I have the data as a DataFrame and I can create 1D visualizations such as histograms, and also see the correlations by calling data.corr().I would like to create a scatter plot to represent the correlation between 'age' and 'survived'.  I can't figure out how to plot this data because 'survived' is effectively an integer of 0 or 1 (died or lived, respectively)If I do something like:titanic_data.plot(x='Age', y='Survived', style='o')I get a plot that looks like this:What I would like is a plot that somehow takes the average survival rate by age and created something more like this:
Plotting relationship between 2 data points where one data point is a boolean
python;pandas
You can precalculate the survival rate (probability) and plot a bar plot:import seaborn as snsx = sns.load_dataset('titanic')bins = np.linspace(0, 100, 11)labels = bins[1:]# let's group all ages by bins (10, 20, 30, ..., 100)    rpt = (x.groupby(pd.cut(x.age, bins, labels=labels))        .survived.mean()*100      ).dropna().to_frame('survival_rate')rpt.plot.bar(rot=0, width=0.8, alpha=0.5, figsize=(12, 10))calculated data:In [84]: binsOut[84]: array([   0.,   10.,   20.,   30.,   40.,   50.,   60.,   70.,   80.,   90.,  100.])In [85]: labelsOut[85]: array([  10.,   20.,   30.,   40.,   50.,   60.,   70.,   80.,   90.,  100.])In [86]: rptOut[86]:      survival_rateage10.0      59.37500020.0      38.26087030.0      36.52173940.0      44.51612950.0      38.37209360.0      40.47619070.0      23.52941280.0      20.000000