top of page
Image by Olisa Obiora

Project
titanic

Why Titanic?

The Titanic incident that occurred in 1912 is well-known to many people and is a big topic even until this day.  That's almost 109 years of talks about the incident! I was excited when Code Ninja recommended this project to me as it gave me the opportunity to investigate the situation myself. Furthermore, it put my coding abilities to the test and I have gained so much from this experience!

Project overview

Through this project, I wanted to investigate how the passengers' survival rate was affected by 4 factors: gender, fare paid, class, and family size.  To start off,  I used pandas, seaborn, matplotlib.pyplot, and a file from Kaggle to obtain my data.

#1: Was survival affected by GENDER (sex)?

If you watched the Titanic Movie, you would have heard the line "Women and children first!" Was this really true in the real incident? How many women were saved as a result? Let's find out! 

sex vs survival.jpg

As you can see from the results, the survival rate of a women was about 50% more than that of a male! But exactly how big is this difference? 

survival rate by sex_edited.jpg

From this graph, it is evident that the number of males who didn't make it was more than four times the number of women (blue). On the other hand, the number of females who survived was twice the number of females (orange). Unfair isn't it? But gender was definitely a factor affecting a passengers' chance at survival. 

#2: Was their survival rate affected by their FARE PRICE?

survival vs fare.jpg

Fare range did indeed affect a passenger's survival rate! Those who paid lower prices had a lower survival rate while those who paid higher had a better chance at survival. 

#3: Was survival rate affected by a passenger's CLASS?

We learnt that prices paid definitely affected the chance of survival, but does this go the same for class?

class vs survival.jpg

From this heatmap, it is seen that passengers from Class 1 had a higher chance of survival than that of Class 2 & 3. However, it is weird that the number of Class 2 survivors is lower than Class 3. This could be because of the positioning of the various class facilities in the Titanic. Overall, it is true that the survival rate was affected by class.

#4: Was survival rate affected by FAMILY SIZE?

Last but not least, we'll be looking at the relationship between family size and survival rate. Will larger families survive better because they can better protect each other? Or is it better to be alone in this situation? First let's code up a Factor Plot!

family size.jpg

Comparing the two graphs below, it appears that there is a better chance at survival as a family, rather than being alone. However, if the family size is above 3, the survival rate decreases significantly! 

Screenshot 2021-07-12 223137.jpg
Screenshot 2021-07-12 223104.jpg

Conclusion

Through this mini-investigation, we've learnt that gender, pricing, class, and family size definitely affect a passenger's chance at surviving the Titanic incident. Maybe these are some of the things we could take into consideration when booking our next cruise?

Overall, this project has helped me to better understand and discover answers to some of my questions regarding the Titanic incident. It was also through these kind of investigations that brought innovation and evolution, leading to inventions and ideas on how to prevent such a calamity from occurring again.  

bottom of page