【问题标题】:Pysal OLS function can not show summary outputPysal OLS 函数无法显示摘要输出
【发布时间】:2019-08-31 14:28:20
【问题描述】:

我在 python 中尝试了 PYSAL 库的基本 OLS 方法,我遵循了 pysal 库的官方文档,出于某种原因,可以显示 OLS 的摘要它说“str”对象没有属性“summary”

YVar='cena'
XVars = ["km", "stari", "diesel"]

Y=data[YVar].as_matrix().reshape((len(data),1))
X=data[XVars].as_matrix()


ols=ps.model.spreg.OLS(Y,X,name_y=YVar, name_x=XVars,nonspat_diag=True, white_test=True)
# till here it works perfectly



print("ols".summary())

【问题讨论】:

    标签: python economics pysal


    【解决方案1】:

    您想打印ols 变量,但您试图将"ols" 打印为文本字符串。引号不应该在那里。

    print(ols.summary())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-03
      • 1970-01-01
      • 2014-03-11
      • 1970-01-01
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多