Exercises
Create the following visualizations using what you have learned up to this point in this book. Use the data from this chapter's data/
directory:
- Plot the rolling 20-day minimum of the Facebook closing price using
pandas
. - Create a histogram and KDE of the change from open to close in the price of Facebook stock.
- Using the earthquake data, create box plots for the magnitudes of each
magType
used in Indonesia. - Make a line plot of the difference between the weekly maximum high price and the weekly minimum low price for Facebook. This should be a single line.
- Plot the 14-day moving average of the daily change in new COVID-19 cases in Brazil, China, India, Italy, Spain, and the USA:
a) First, use the
diff()
method that was introduced in the Working with time series data section of Chapter 4, Aggregating Pandas DataFrames, to calculate the day-over-day change in new cases. Then, userolling()
to calculate the 14-day moving average.b) Make three subplots...