xdata = (np.array(ret_rates.time_since_acqm)).reshape(-1,1) #xdata.reshape(-1,1) plt.plot(xdata, ret_rates.value_retention) model = LinearRegression().fit(xdata, ret_rates.value_retention) y_pred = model.predict(xdata) plt.plot(xdata, y_pred) ##be sure to reshape the x value so you can get the ypred against it