In [1]:
import pickle
import pandas as pd
import numpy as np
import random
from matplotlib import pyplot as plt
In [2]:
%matplotlib notebook
In [38]:
results = pd.read_csv('/media/128G/bathhacked/BANES_Historic_Car_Park_Occupancy.csv', engine='c', parse_dates=['LastUpdate'], dayfirst=True)
In [45]:
results.reset_index()
results['LastUpdate2'] = results['LastUpdate']
results = results.set_index('LastUpdate')
results = results.sort_index()
In [46]:
results[results['Name'] == "Odd Down P+R"]['Occupancy'].plot()
Out[46]:
In [49]:
def hr_func(ts):
return ts.hour
results['time_hour'] = results['LastUpdate2'].apply(hr_func)
In [48]:
def day_of_month(ts):
return ts.day
results['day_of_month'] = results['LastUpdate2'].apply(day_of_month)
In [52]:
results[results['day_of_month'] == 12.0].groupby('Name').mean()
Out[52]:
In [ ]: