# and the predictions and the residual CBE.loc[:'1989-12-31', 'scores'] = mod_fit.predict(X) CBE.loc[:'1989-12-31', 'resids'] = CBE.loc[:'1989-12-31', 'scores'] - CBE.loc[:'1989-12-31', 'elec_log']