Question: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns titanic = # load titanic.csv first _ south = # subset the titanic

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
titanic = # load titanic.csv
first_south = # subset the titanic dataset to include first class passengers who embarked in Southampton
second_third = # subset the titanic dataset to include either second or third class passengers
print(first_south.head())
print(second_third.head())
# Set the style of the bar charts
sns.set_theme(style="whitegrid", color_codes=True)
# Create a bar chart for the first class passengers who embarked in Southampton grouped by sex
# Your code here
plt.savefig('bar_1.png')
# Create a bar chart for the second and third class passengers grouped by survival status
# Your code here
plt.legend(labels=["0","1"], title = "survived")
plt.savefig('bar_2.png')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!