Exercises
- Use
adult.csv
and Boolean masking to answer the following questions:a. Calculate the mean and median of
education-num
for every race in the data.b. Draw one histogram of
education-num
that includes the data for each race in the data.c. Draw a comparative boxplot that compares the
education-num
for each race.d. Create a subplot that puts the visual from b) on top of the one from c).
- Repeat the analysis on 1, a), but this time use the
groupby
function.a. Compare the runtime of using Boolean masking versus groupby (hint: you can import the module time and use the
.time()
function). - If you have not already done so, solve Exercise 4 in the previous chapter. After you have created
pvt_df
for Exercise 4, run the following code:import seaborn as sns sns.pairplot(pvt_df)
The code outputs what is known as a scatter matrix. This code takes advantage of the Seaborn module, which is another very useful visualization module. To practice subplots and resizing, recreate what...