← Back to list

Exploring the Titanic Dataset: Week 2 Assignment

When I first looked at the Titanic dataset for our Week 2 assignment, I was a bit overwhelmed. I mean, 891 rows and 15 columns! 😅 But by…

Ruhmmachaudhary · 2026-03-25 09:56 · 0 claps · 1.8 min read
#ai #machine-learning #dataset #titanic-dataset
Open on Medium ↗
Wiki topics: ML · Machine Learning AI · AI · General EDU · Education & Learning

Exploring the Titanic Dataset: Week 2 Assignment

When I first looked at the Titanic dataset for our Week 2 assignment, I was a bit overwhelmed. I mean, 891 rows and 15 columns! 😅 But by breaking it down step by step, I realized data analysis can actually be really fun and insightful. Here’s how I explored this historic dataset and uncovered some interesting patterns.

Understanding the Dataset

The Titanic dataset contains details about passengers aboard the Titanic, including whether they survived, their age, gender, class, fare, and more. Some columns were straightforward (survived, sex, pclass), while others like deck and embark_town had missing values.

Before diving in, I made sure to inspect the dataset carefully:

  • Total entries: 891
  • Columns: 15
  • Missing data: Some passengers didn’t have age recorded, and deck info was mostly missing

Cleaning the Data

Data is messy in real life, and the Titanic dataset was no exception. Here’s what I did:

  • Filled missing age values with the median age
  • Filled missing embarked values with the most common port
  • Dropped the deck column because too many values were missing

After cleaning, the dataset was ready for analysis.

Exploratory Data Analysis (EDA)

I used Pandas for data handling and Seaborn & Matplotlib for visualizations.

1️ Survival Count

The first thing I checked was how many passengers survived.

Observation: Most passengers did not survive, which was sadly expected.

2️ Gender vs Survival

Next, I compared survival rates by gender.

Observation: Females had a much higher survival rate than males.

3️ Passenger Class vs Survival

Class clearly played a role in survival chances.

Observation: Passengers in first class were more likely to survive compared to third-class passengers.

4️ Age Distribution

I plotted the age distribution to see who the passengers were.

Observation: Most passengers were between 20–40 years old, with a few children and elderly onboard.

5️ Fare Distribution

The fare distribution gave insights into socioeconomic status.

Observation: Higher fares generally correlated with better survival chances.

6️ Correlation Heatmap

Finally, I looked at the correlation between numeric features.

Observation: Pclass and Fare showed a strong correlation with survival, which made sense given the class-based prioritization during rescue.

Final Insights

After exploring the dataset, here are my key takeaways:

  • Gender matters: Females survived more than males
  • Class matters: First-class passengers had better survival chances
  • Age & Fare: Slightly influenced survival
  • Data cleaning is crucial: Missing values can distort insights

Tools & Libraries Used

  • Python
  • Pandas — for data manipulation
  • NumPy — for numerical calculations
  • Matplotlib & Seaborn — for visualizations

Closing Thoughts

Exploring the Titanic dataset taught me a lot about handling real-world data. Even a dataset from over 100 years ago can reveal fascinating stories when you dig into the numbers. I learned that cleaning and visualizing data properly can uncover patterns that aren’t immediately obvious.

I can’t wait to apply these skills to more datasets in the upcoming weeks!


메타데이터
post_id
13e9ca2aa355
slug
exploring-the-titanic-dataset-week-2-assignment-13e9ca2aa355
url
https://medium.com/@ruhmmachaudhary/exploring-the-titanic-dataset-week-2-assignment-13e9ca2aa355
canonical_url
https://medium.com/@ruhmmachaudhary/exploring-the-titanic-dataset-week-2-assignment-13e9ca2aa355
author_url
https://medium.com/@ruhmmachaudhary
status
ok
fetched_at
2026-07-10 08:54:07