Solved! Go to Solution.
Hello,
I want write a python code block using " geoprocessing calculate field that adds a text field to the roads.shp feature class called FERRY. This new field should be populated with values of YES and NO depending on the value of the FEATURE field. If the value of the FEATURE field is ‘Ferry Crossing’, the value of the FERRY field should be YES – otherwise the value of the
FERRY field should be NO.
if this is a field calculation, with "a" containing the data and "b" being updated
def calc(a):
""" """
if a == "Ferry Crossing":
return "YES"
return "NO"
python parser
expression calculating into field "b"
calc(!a!)
Where the field name (a) is enclosed in !
You can use this code block and expression in CalculateField
Hello,
I want write a python code block using " geoprocessing calculate field that adds a text field to the roads.shp feature class called FERRY. This new field should be populated with values of YES and NO depending on the value of the FEATURE field. If the value of the FEATURE field is ‘Ferry Crossing’, the value of the FERRY field should be YES – otherwise the value of the
FERRY field should be NO.
if this is a field calculation, with "a" containing the data and "b" being updated
def calc(a):
""" """
if a == "Ferry Crossing":
return "YES"
return "NO"
python parser
expression calculating into field "b"
calc(!a!)
Where the field name (a) is enclosed in !
You can use this code block and expression in CalculateField