Reputation: 199
I am trying to use the erf function with python and I come across the error:
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'
This is my code:
import math
from scipy.special import erf
SQRT2 = math.sqrt(2.0)
x=2
ERRMUL = 1.0
def getQ(x):
q = math.log(1.0-erf.erf(math.abs(x)/SQRT2))
print q
getQ(x)
Is there a specific module I'm supposed to be implementing?
Upvotes: 2
Views: 1665