x = frame_query("select * from table",db) y = frame_query("select * from table",db) x1 = np.array(x) y1 = np.array(y)
coefficients = np.polyfit(x1, y1, 1) polynomial = np.poly1d(coefficients) ys = polynomial(x1)