2024-09-24 22:24:30 发布
网友
我试图在python中使用erf函数,但遇到错误:
File "java.py", line 40, in <module> getQ(x) File "java.py", line 13, in getQ q = math.log(1.0- erf.erf(math.abs(x)/SQRT2)) AttributeError: 'numpy.ufunc' object has no attribute 'erf'
这是我的代码:
有没有一个我应该实现的特定模块?在
您只需要调用^{},而不是erf.erf(它不存在,因此引发异常),它只是abs而不是{}:
erf.erf
abs
def getQ(x): q = math.log(1.0-erf(abs(x)/SQRT2)) print(q)
您只需要调用^{} ,而不是}:
erf.erf
(它不存在,因此引发异常),它只是abs
而不是{相关问题 更多 >
编程相关推荐