python - UDF: IndentationError: unindent does not match any outer indentation level -
when execute code, error indentationerror: unindent not match 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())
what doing wrong?
the code posted not have indentation error. @ line number reported in error message. see this:
xxxx xxxxx xxxxx xxxxx ^ unindent causing problem
Comments
Post a Comment