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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -