I need help in writing the python script in the field calculator. I have three fields namely: CODE COMPLEX Map1
Map1 is an empty field that I want to populate. I have a number of conditions to cater with in a single Map1 field. e.g. If CODE is 1.1.7 and COMPLEX is 4 then the output for Map1 should be 1.3, and these conditions continue with different CODE and COMPLEX values. I have been trying to write it like this but it doesn't work:
Parser Python
Code Block
def Reclass( !CODE! , !COMPLEX! ):
if ( !CODE! == 1.1.7 and !COMPLEX! == 4):
return 1.3
elif ( !CODE! == 3.2.0 and !COMPLEX! == 4):
return 1.3
else:
return 0
Map1 =
Reclass( !CODE! , !COMPLEX! )
Can anyone tell me where I am making a mistake? Or any other way of doing it?