In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
deadhead = pd.read_csv('../data/4mo_deadhead_results.csv')
In [3]:
plt.figure(figsize=(10,7.5))
ax = plt.subplot(111)
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()
plt.xticks(fontsize=14)
plt.yticks(range(0, 4000, 400), fontsize=14)
plt.xlabel("Percent Deadhead", fontsize=16)
plt.ylabel("Count", fontsize=16)
plt.hist(deadhead.PctDeadhead * 100, color="#3F5D7D", bins=60)
plt.axvline(np.mean(deadhead.PctDeadhead*100), color='w')
plt.axvline(np.median(deadhead.PctDeadhead*100), color='m')
#plt.axvline(np.mean(deadhead.PctDeadhead*100) + np.std(deadhead.PctDeadhead*100), color='w')
#plt.axvline(np.mean(deadhead.PctDeadhead*100) - np.std(deadhead.PctDeadhead*100), color='w')
#plt.axvline(np.mean(deadhead.PctDeadhead*100) + 2 * np.std(deadhead.PctDeadhead*100), color='w')
#plt.axvline(np.mean(deadhead.PctDeadhead*100) - 2 * np.std(deadhead.PctDeadhead*100), color='w')
plt.show()
print(str(np.mean(deadhead.PctDeadhead*100)) + '% is mean')
print(str(np.median(deadhead.PctDeadhead*100)) + '% is median')