我正在尝试用python编写一个程序,它使用SQL中的查询来收集数据并建立回归模型。然而,当我尝试实际创建模型时,它给出了这个错误。)
fit = sm.OLS(y, x).fit() #This is where the error is occurring 我很确定我知道哪里出了问题,但我不知道如何修复它
我有一个df,它是700 rows x 2 columns,下面是一个代码,用于复制一个较小的版本(有7行)。fit = ols('C(Private) ~ C(Elite)', data=df_train).fit()
完全错误是:--> 206 raise ValueError('endog has evaluated to an array