Print OLS regression summary to text file
问题 I am running OLS regression using pandas.stats.api.ols using a groupby with the following code: from pandas.stats.api import ols df=pd.read_csv(r'F:\file.csv') result=df.groupby(['FID']).apply(lambda d: ols(y=d.loc[:, 'MEAN'], x=d.loc[:, ['Accum_Prcp', 'Accum_HDD']])) for i in result: x=pd.DataFrame({'FID':i.index, 'delete':i.values}) frame = pd.concat([x,DataFrame(x['delete'].tolist())], axis=1, join='outer') del frame['delete'] print frame but this returns the error: AttributeError: 'OLS'