I have two fields showing number of people in two age groups "young" and "old". these people also live in a cell (point) whose distance to a specific facility is calculated. then I categorized these distances to two groups of "far" and "close".
Now, I want to create four new fields that the values of "Old_far" and "young_far" will the exact values of aforementioned population groups if the cell is located in the group of far, otherwise they will be zero and the values go to the field of "Old_close" and "Young_close". the code for a field I tried follows:
-for old_far:
def func(X):
if X==2:
return !old!
else:
return 0
Old_Far =
func(!distance_group!)
the code above returns an error of "exceptions.SyntaxError: Invalid syntax(Line 3)"
I want to reach the value of the "old" field of the same record. Should I some how reach the value of that field?
I am using ArcGIS Desktop 10.1.