In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
In [2]:
plt.style.use('seaborn')
In [3]:
from jupyterworkflow.data import get_fremont_data
In [4]:
data = get_fremont_data()
In [5]:
data.index
Out[5]:
In [6]:
data.plot()
Out[6]:
In [7]:
data.resample('W').sum().plot()
Out[7]:
In [8]:
#data.resample('W', sum).plot()
In [9]:
data['Total'] = data['West'] + data['East']
ax = data.resample('D').sum().rolling(365).sum().plot()
ax.set_ylim(0, None)
Out[9]:
In [10]:
data.groupby(data.index.time).mean().plot()
Out[10]:
In [11]:
data.head()
Out[11]:
In [12]:
pivoted = data.pivot_table('Total', index = data.index.time, columns=data.index.date)
In [13]:
pivoted.iloc[:24, :5]
Out[13]:
In [14]:
pivoted.plot(legend = False, alpha = 0.01)
Out[14]:
In [15]:
pivoted.index
Out[15]:
In [16]:
get_fremont_data()
Out[16]:
In [ ]: