Q3 homework Flashcards

1
Q

Create a dataframe that includes the numbers of males and females from the titanic.

A

sex_df = titanic_df.groupby(‘sex’).size()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create slices for the pie plot based on the count of the number of males and females.

A

slices = sex_df.values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Create a dataframe that includes the proportion of passengers in each class

A

class_df = titanic_df.groupby(‘pclass’).size()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create slices for a pie plot based on the class_df dataframe

A

slices = class_df.values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Find and remove any values that have a fare greater than 400

A

no_outliers_df = age_fare_df[age_fare_df[‘fare’]<400]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the code to create subplots, specifying a figure size of 15, 5 and 3 subplots?

A

fig, axs = plt.subplots(1, 3, figsize=(15, 5))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly