合并数据框时出现尺寸错误

时间:2019-10-15 17:30:22

标签: python pandas numpy

我试图在数据集上实现sm.OLS(y,x).fit(),但是错误指出y和x的长度不同。在我的代码中,较早的是x是通过合并data_prep_num = pd.merge(data_prep_num,data_prep_text_manual_onehot,right_index=True,left_index=True)得出的,data_prep_num(after merging)的维度为1458 X 81,其中data_prep_num and data_prep_text_manual_onehot的维度为1459 X x

如果我可以匹配x=data_prep_numy=data_sales_price_old的尺寸,那么我猜这个错误可以解决> ValueError:Endog和Exog矩阵的大小不同。

0 个答案:

没有答案