I want assign 33 if the field no_apt is zero and 34 if no_apt is any else value. The model run without any error, but no value are assigned the field GGV_kW. What is wrong with the code since it doesn't work?
The code used is:
in_Table=nodesFeatureoutall
fieldName="GGV_kW"
expression="GGV_calculation( !no_apt!, !GGV_kW!)"
codeblock = """
def GGV_calculation(no_apt,GGV_kW):
if no_apt==0:
return 33
else:
return 34"""
arcpy.CalculateField_management(in_Table,fieldName,expression,"PYTHON",codeblock)
no_apt
is a numeric field.nodesFeatureoutall
defined to?