Starting the Voyage: Exploring the Titanic Dataset

Welcome to our course, Intro to Data Visualization with Titanic - an in-depth exploration into the techniques and methodologies of data visualization using Python. This course is designed to provide you with comprehensive insights into real-world scenarios, helping you understand the invaluable concept of data visualization and its applications in today's data-driven world.

In the first lesson of this course, we will explore the detailed properties of the Titanic dataset available from Seaborn - the dataset containing the demographic and passenger information from the 891 surviving passengers out of the 2214 on board the Titanic.

Understanding the data we're working with is foundational in data analysis because it lets us gain better insights into it and spot potential errors. It also helps us form a reliable basis for further intricate analysis. The runtime of this process can vary solely based on the characteristics of the dataset and what we intend to understand from it.

So, let's delve in and explore the Titanic dataset to understand further the people who pursued their fate on Titanic.

Insight into Features of the Titanic Dataset

We shall begin our voyage into the dataset by understanding the various attributes of the Titanic dataset.

First, let's briefly go over the features of the Titanic dataset:

  • survived: Whether the passenger survived (0 = No; 1 = Yes).
  • pclass: Passenger class (1 = 1st; 2 = 2nd; 3 = 3rd).
  • sex: Sex of the passenger (male or female).
  • age: Age of the passenger (float number).
  • sibsp: Number of siblings/spouses aboard.
  • parch: Number of parents/children aboard.
  • fare: Passenger fare (in British pounds).
  • embarked: Port of Embarkation (C = Cherbourg; Q = Queenstown; S = Southampton).
  • ... and more!

By discussing these attributes, let's familiarize ourselves with the Titanic dataset available in Seaborn.

import seaborn as sns

titanic_df = sns.load_dataset('titanic')
print(titanic_df.head())
# This command shows the first five entries of the DataFrame

The output of the head command is in the following table:

   survived  pclass     sex   age  ...  deck  embark_town  alive  alone
0         0       3    male  22.0  ...   NaN  Southampton     no  False
1         1       1  female  38.0  ...     C    Cherbourg    yes  False
2         1       3  female  26.0  ...   NaN  Southampton    yes   True
3         1       1  female  35.0  ...     C  Southampton    yes  False
4         0       3    male  35.0  ...   NaN  Southampton     no   True

Each row here represents a different passenger on the ship, while each column corresponds to one of the features described above.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal