I am attempting to set a newly created field based on the strings in another field 'TNMFRC'. I am pretty sure that I have the code write, and yet everything is set to a value of '6'. Here's my code:
def myCalc(road): if road == "Local Road": return 1 elif road == "Controlled-access Highway": return 2 elif road == "Secondary Highway or Major Connecting Road": return 3 elif road == "Ramp": return 4 elif road == "4WD": return 5 else: return 6and in the other box:
myCalc(!TNMFRC!)Here are screenshots of the fields and the field calculator:
Can anyone see what I might be doing wrong? I can't figure it out.
أكثر...
def myCalc(road): if road == "Local Road": return 1 elif road == "Controlled-access Highway": return 2 elif road == "Secondary Highway or Major Connecting Road": return 3 elif road == "Ramp": return 4 elif road == "4WD": return 5 else: return 6and in the other box:
myCalc(!TNMFRC!)Here are screenshots of the fields and the field calculator:


Can anyone see what I might be doing wrong? I can't figure it out.
أكثر...