Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active November 26, 2018 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/186695ec2b6f14b7efd7d0e98d944652 to your computer and use it in GitHub Desktop.
Save maptastik/186695ec2b6f14b7efd7d0e98d944652 to your computer and use it in GitHub Desktop.
A little function for use in ArcGIS to determine in a very particular case if a field is a 0 or a null. Turns null into -1 because shapefiles don't do null values. This is poorly documented...grr.
def calc(main_code, field_list):
if sum(field_list) == 0:
return -1
else:
return main_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment