First, save data location URL so we can access anytime
In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('seaborn')
In [2]:
from jupyterworkflow.data import get_fremont_data
In [3]:
df = get_fremont_data()
In [4]:
df.resample('W').sum().plot()
Out[4]:
In [5]:
ax = df.resample('D').sum().rolling(365).sum().plot()
ax.set_ylim(0, None); # sets y axis to 0 at bottom, and automatic at top
In [6]:
df.groupby(df.index.time).mean().plot()
Out[6]:
In [7]:
pivoted = df.pivot_table('Total', index=df.index.time, columns=df.index.date)
pivoted.iloc[:5, :5]
Out[7]:
In [8]:
pivoted.plot(legend=False, alpha=0.02);
In [ ]: