Professional Documents
Culture Documents
Code Diagram - C196
Code Diagram - C196
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.
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
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.
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.
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.