In [1]:
import pandas as pd
import matplotlib.pyplot as plt
In [2]:
data = pd.read_csv('../data/4mo_deadhead_results.csv')
data.head()
Out[2]:
In [3]:
data[data.PctDeadhead > 0.9]
Out[3]:
In [4]:
full_data = pd.read_csv('../data/UW_Trip_Data_FullHeaders.csv')
full_data.head()
Out[4]:
In [5]:
full_data[(full_data.ServiceDate == '0015-04-13') & (full_data.Run == '2021')]
Out[5]:
In [6]:
eights = full_data[full_data.Activity == 8]
eights.head()
Out[6]:
In [7]:
eight_runs = eights[['ServiceDate','Run']].drop_duplicates()
eight_runs.head()
Out[7]:
In [8]:
subset = data[data.Run.isin(eight_runs.Run)]
subset = subset[subset.ServiceDate.isin(eight_runs.ServiceDate)]
subset.head()
Out[8]:
In [9]:
new_data = pd.read_csv('../data/4mo_deadhead_results.csv')
In [10]:
plt.hist(data.PctDeadhead)
plt.show()
plt.close()
plt.plot(data.PctDeadhead, data.CostProxy, 'ro')
plt.xlabel('Percent Deadhead')
plt.ylabel('Length of Trip / Number of passengers (seconds)')
plt.show()
plt.close()
In [11]:
new_data[new_data.PctDeadhead > 0.9]
Out[11]:
In [12]:
test = full_data[(full_data.ServiceDate == '0015-04-13') & (full_data.Run == '2021')]
test
Out[12]:
In [13]:
print test.Activity.unique()
if 8 in test.Activity.unique():
print 'true'
else:
print 'false'
In [14]:
full_data[(full_data.ServiceDate == '0015-04-13') & (full_data.Run == 2064)]
Out[14]:
In [15]:
brokenruns = pd.read_csv('../data/4mo_broken_buses.csv', index_col=0)