
[英]Why does my python program throw an error when running it with the debugger doesn't?
[英]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.2
和PyCharm 2022.2 (Community Edition)
。
我有点需要使用调试器来找出如何提取它 当我们最后运行
print(results.summary())
时出现。 我已经设法使用print(results.summary().tables[0])
将显示的表格缩小到一个较小的表格,但是没有调试器就束手无策。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.