Exercises
- Use
adult.csvand Boolean masking to answer the following questions:a. Calculate the mean and median of
education-numfor every race in the data.b. Draw one histogram of
education-numthat includes the data for each race in the data.c. Draw a comparative boxplot that compares the
education-numfor 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
groupbyfunction.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_dffor 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...