Hi community....
I tried to applied field calculation using Python in field type "text" as show below:
Expression:
reclass (!code!)
code block:
def reclass(code):
if (code =13):
return "Industrial"
elif (code = 16):
return "Urban or Built-up Land"
elif (code = 0):
return "Unclassified"
I got an error, please I need your help.
Thank you in advance.
Solved! Go to Solution.
python parser
def reclass(code):
if code == 13:
return "Industrial"
elif code == 16:
return "Urban or Built-up Land"
elif code == 0:
return "Unclassified"
equality check is ==
assignment is =
Error message would be useful in case this doesn't cover it.
python parser
def reclass(code):
if code == 13:
return "Industrial"
elif code == 16:
return "Urban or Built-up Land"
elif code == 0:
return "Unclassified"
equality check is ==
assignment is =
Error message would be useful in case this doesn't cover it.
Thank you @DanPatterson , I appreciate you.