In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('seaborn')
from module_code.data import get_fremont_data
In [2]:
df = get_fremont_data()
In [3]:
df.head()
Out[3]:
In [4]:
df.resample('W').sum().plot() # ugly looking graphs. Change to seaborn.
Out[4]:
In [5]:
# resample daily and find the rolling sum of 365 days.
ax = df.resample('D').sum().rolling(365).sum().plot()
In [6]:
ax = df.resample('D').sum().rolling(365).sum().plot()
ax.set_ylim(0, None)
Out[6]:
In [7]:
df.groupby(df.index.time).mean().plot()
Out[7]:
In [8]:
pivoted = df.pivot_table('Total', index=df.index.time, columns=df.index.date)
pivoted.iloc[:5,:5]
Out[8]:
In [9]:
pivoted.plot(legend = False, alpha = 0.01)
Out[9]:
In [12]:
get_fremont_data??