Open sbenthall opened 2 years ago
We have some archaic plotting code in the notebooks. Here's an example:
plt.figure(figsize=(12.5, 7.5)) for i, activity in enumerate(acts): colors = 'rgbkm' ta = activity.sum(1) rmta = ta.rolling(window).mean() rmtadna = rmta.dropna() rmtadna plt.plot_date(np.array(rmtadna.index), np.array(rmtadna.values), colors[i], label=mls[i] + ' activity', xdate=True) plt.legend()
This is a much more concise way to do it:
sum_acts = pd.DataFrame.from_records({mls[i] : a.sum(1) for i,a in enumerate(acts)}) sum_acts.index = sum_acts.index.map(date.fromordinal) window = 100 sns.lineplot(data=sum_acts.rolling(window).mean().dropna(how='all'))
We can make the example code much cleaner and less cumbersome, expecially the earlier notebooks.
We have some archaic plotting code in the notebooks. Here's an example:
This is a much more concise way to do it:
We can make the example code much cleaner and less cumbersome, expecially the earlier notebooks.