Help! I think I am missing something that must be so obvious but I cannot figure out what I am doing wrong. Here's some background:
I have one short integer field (MajAspNum) that has values 1-10. I have another text field (Direction) that needs to be filled. I am trying to use the Field Calculator to calculate it but am not succeeding in any way. I should know what I'm doing but I just can't seem to make it work.
Pre-logic Script Code:
def des(num):
if num = 1:
return "Flat"
elif num = 2:
return "North"
elif num = 3:
return "Northeast"
elif num = 4:
return "East"
elif num = 5:
return "Southeast"
elif num = 6:
return "South"
elif num = 7:
return "Southwest"
elif num = 8:
return "West"
elif num = 9:
return "Northwest"
elif num = 10:
return "North"
else:
return "N/A"
Direction =
des (!MajAspNum!)
It gives me a GeoProcessing error of invalid syntax on line 2. I have tried just selecting by attributes in the attributes table and then using field calculator more simply on just those but that gives me a very weird error that literally makes no sense. I'm hoping my error is a really obvious fix to someone out there!