[Tutor] TypeError: unsupported operand type(s)
SATYABRATA DATTA
iamsatyabrata428 at gmail.com
Sun Mar 22 11:10:47 EDT 2020
def x1(ap,dp,ph,e1,e2,e3,e4,e5,y):
if Delta(ap,dp,ph,e1,e2,e3,e4,e5,y) >= 0:
return 2*(b(ap,dp,ph,e1,e2,e3,e4,e5,y)**3) -
9*a*b(ap,dp,ph,e1,e2,e3,e4,e5,y)*c(ap,dp,ph,e1,e2,e3,e4,e5,y) +
27*(a**2)*d(ap,dp,ph,e1,e2,e3,e4,e5,y)
else:
return None
def y1(ap,dp,ph,e1,e2,e3,e4,e5,y):
if Delta(ap,dp,ph,e1,e2,e3,e4,e5,y) >= 0:
return 3*np.sqrt(3)*a*np.sqrt(Delta(ap,dp,ph,e1,e2,e3,e4,e5,y))
else:
return None
This is creating a problem
return
np.sqrt(x1(ap,dp,ph,e1,e2,e3,e4,e5,y)**2+y1(ap,dp,ph,e1,e2,e3,e4,e5,y)**2)
TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int'
I think the main problem is due to the condition for Delta>=0 which returns
a None value for some input dataset but I only need the Delta>=0 condition
values
More information about the Tutor
mailing list