当我执行此代码时,我收到错误IndentationError: unindent does not match any outer indentation level
:
def calculate(num1, num2):
if (num1/num2 > 1):
num1 = num2
result = (num1 - num2) / math.sqrt(1-(num1/num2))
return result
df = udf(calculate, FloatType())
我做错了什么?
答案 0 :(得分:0)
您发布的代码没有缩进错误。查看错误消息中报告的行号。你会看到这样的东西:
xxxx
xxxxx
xxxxx
xxxxx
^ this is the unindent that is causing the problem