Analyze Titanic passenger data by gender and embarkation port to identify key survival factors. Gender and embarkation points significantly influenced survival rates on the Titanic.
Key Insights
- Gender significantly impacted survival rates on the Titanic, with women having notably higher survival rates compared to men.
- Passengers who embarked from port "C" demonstrated higher survival odds, while those who boarded at ports "S" and "Q" had survival rates of approximately 30–40%.
- Using the seaborn library's countplot function facilitates clear visualization of survival data by combining multiple variables within the Titanic dataset.
Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.
Let's take a look at two more bits of data, two more features that we think might be important. We'll plot our survival by gender. The way we're going to do that is we're going to say xs = sns.countplot where our X is survived, our hue is sex, and our data is still Titanic data.
And here we have Titanic survival by gender. Men perished at a higher rate. Women survived at a higher rate overall.
So this also seems like it could be an important one. Finally, we're going to look at the port of embarkation, meaning which port they boarded the Titanic at. We'll do the same kind of thing.
We'll create our countplot where X is survived, hue is embarked, and our data is still Titanic data. Let's see what that looks like. So of the three ports (S, Q, and C), passengers from S perished at about two-thirds, Q had a 60-70% death rate, and C had a higher survival rate than death rate.
This also seems like it could be an important factor. We'll look at how to combine this stuff even further in the next video.