Skip to content

Instantly share code, notes, and snippets.

@mattfoster
Created February 6, 2009 12:44
Show Gist options
  • Save mattfoster/59382 to your computer and use it in GitHub Desktop.
Save mattfoster/59382 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as plt
import time
from datetime import datetime
f = plt.load('heist_countdown')
x = f[:,1]
y = f[:,0]
A = np.vstack([x, np.ones(len(x))]).T
m, c = np.linalg.lstsq(A, y)[0]
# Uncomment for a plot!
plt.plot(x, y )
plt.plot(x, y, 'x', label='Web Data')
xx = np.arange(490, 505, 5)
plt.plot(xx, m*xx + c, 'r', label='Fitted line')
plt.title('MacHeist Release Estimate')
plt.xlabel('Bar Width')
plt.ylabel('Time')
plt.legend()
plt.show()
est = m*500 + c
print "MacHeist Completion Estimate:",
print datetime.fromtimestamp(est).strftime("%Y-%m-%d %H:%M:%S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment