You are on page 1of 13

TITANIC:

THE LOCATION AT WHICH TITANIC SANK IN NORTHERN WATERS OF ATLANTIC


OCEAN.
Histogram: ​A Histogram is basically the data represented in the form of some groups.
It is a graphical representation of numerical data. When we plot the Histogram, the
x-axis represents the groups of the data, these groups can be called as bins or a range,
while the y-axis represents the frequencies that is the number of times that data has
occurred.

For example: An exam is conducted in a class, students get the marks in range 0-25,
25-50, 50-75, 75-100. So by plotting the histogram, we come to know, exact number of
students or count of students who secured the marks in a particular range.

Stacked Bar graph - ​A stacked bar graph can be said to be a group of data, which can
be plotted one above the other along the same bar height.

For example: in a school, we can count how many total students are there in a class
and out of them how many have opted for languages like French. So it can be plotted
like this :
So there are, 30 students in one class, out of them, 10 students have opted for French
language, similarly 45 students in one class and 20 students are going for French
language and 25 students in one class and nearly 10 students going for French
language.

1) PREDEFINED CODE TO LOAD THE IMAGE:


Activity 1
2) Import necessary packages and read the csv file;

Output:
3) Drop the rows with NaN values and find the passengers who survived the Titanic
disaster.

Output:

4) Plot the histogram showing the passengers of titanic from different age groups
who survived.
Output:

Conclusion:
Insights:
1) If you see clearly on the x- axis, there are two lines drawn with red color which
shows the age group between the 15 to 40, and the height of those lines is inline
with the counts on the y-axis, which shows the maximum number of people who
died.
2) So from the Histogram we can conclude that most passengers who survived
were in the age group of somewhere between 15-40.

Activity 2
Objective - Plotting histogram showing the passenger of different age groups
who died

1. Find out the passengers from titanic who died


Output:

2. Plotting histogram for the passengers who died

Output:
Conclusion:

Insights:
1) If you see clearly on the x- axis, there are two lines drawn with red
color which shows the age group between the 45 to 50, and the
height of those lines is inline with the counts on the y-axis, which
shows the maximum number of people who died.

2) So by this observation, we can conclude that the passengers of


different age groups who died were from the age group of 45 to 50.

Activity 3
Objective - Find the total number of passengers who were travelling and plot a
stacked bar graph of total number of passengers who died from class1, class 2,
and class 3.

1. Predefined code to display the image.


Total number of passengers in class 1

Total number of Survived passengers in class 1

Total number of passengers in class 2

Total number of Survived passengers in class 2


Total number of passengers in class 3

Total number of Survived passengers in class 3

Plotting stacked graph for showing different passengers who died from class1, class2,
class3

Output:
Insights:
1) If we look at the above graph, we can see the maximum number of passengers
have died from the 1st class.

You might also like