Exercise

Plotting mean frequency

Lastly, we'll create a per-day average of the mentions of both hashtags and plot them across time. We'll first create proportions from the two boolean Series by the day, then we'll plot them.

matplotlib.pyplot has been imported as plt and ds_tweets has been loaded for you.

Instructions

100 XP
  • Generate the mean number of tweets with the python column with .resample() and .mean() methods. .resample() takes one argument, '1 d', to produce daily averages.
  • Do the same with the rstats column.
  • Plot a line for #python usage with mean_python. Use mean_python.index.day as the x-axis.
  • Do the same with mean_rstats.