Research what boxplots are, what information they convey, and why they are useful.
Open a notebook and load the Titanic dataset:
import seaborn as sns
df = sns.load_dataset("titanic")Render some boxplots, and try to answer the following questions
- a) Is there a relationship between
ageandpclass(passenger class)? (e.g. did passengers in 1st class tend to be older than those in 2nd and 3rd class?) - b) Did passengers who survived tend to be younger or older than those who didn't?
- c) How does ticket fare vary across passenger classes — and which class has the most outliers?
- Display other types of plots using that same dataset
Question A
plt.figure(figsize=(4, 6))
sns.boxplot(data=titanic_df, x='pclass', y='age')
plt.xlabel('Passenger Class')
plt.ylabel('Age')
plt.title('Age Distribution by Passenger Class')
plt.show()Result:

