繁体   English   中英

调试器在运行脚本时抛出错误没有 - statsmodels

[英]debugger throws error whilst running script doesn't - statsmodels

这是最小的可重现示例:

if __name__ == '__main__':
    import statsmodels.api as sm
    import numpy as np
    duncan_prestige = sm.datasets.get_rdataset("Duncan", "carData")
    Y = duncan_prestige.data['income']
    X = duncan_prestige.data['education']
    X = sm.add_constant(X)
    model = sm.OLS(Y, X)
    results = model.fit()

没有任何断点,使用调试器运行它会引发错误

... 
dtype = numeric.dtype(type(dtype)) 
TypeError: 'NoneType' object is not callable 
python-BaseException

在没有调试器的情况下运行它似乎工作得很好。

我正在使用Python 3.10.2PyCharm 2022.2 (Community Edition)

我有点需要使用调试器来找出如何提取它在此处输入图像描述 当我们最后运行print(results.summary())时出现。 我已经设法使用print(results.summary().tables[0])将显示的表格缩小到一个较小的表格,但是没有调试器就束手无策。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM