nums"># The window is number of observations that are averaged roll_df = reshaped_df.rolling(window=6).mean() plt.figure(figsize=(16,10)) plt.xticks(fontsize=14) plt.yticks(fontsize=14) plt.xlabel('Date', fontsize=14) plt.ylabel('Number of Posts', fontsize=14) plt.ylim(0, 35000) # plot the roll_df instead for column in roll_df.columns: plt.plot(roll_df.index, roll_df[column], linewidth=3, label=roll_df[column].name) plt.legend(fontsize=16)
Now our chart looks something like this:

Play with the window argument (use 3 or 12) and see how the chart changes!