Skip to content

Instantly share code, notes, and snippets.

@maphew maphew/gist:fabd3e2562e943778d0c Secret
Last active Aug 29, 2015

Embed
What would you like to do?
#calculate new field 'summed' in feature class 'test'
inFeatures='test'
fieldName01='summed'
exSummed = "stack(!field01!+!field02!+!field03!)"
codeBlock = '''
def stack(*args):
return sum(filter(None, args))
'''
arcpy.CalculateField_management(inFeatures, fieldName01, exSummed, "PYTHON", codeBlock)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.