Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. summed_total = 0
  2. with arcpy.da.SearchCursor(fc, "field to be totaled") as cursor:
  3. for row in cursor:
  4. summed_total = summed_total + row[0]
  5.  
  6. summed_total = 0
  7. field = "field to be summed"
  8. with arcpy.SearchCursor(fc):
  9. for row in cursor:
  10. summed_total = summed_total + row.GetValue(field)
  11.  
  12. import arcpy, numpy
  13.  
  14. fc = r'C:pathtoyourfc'
  15.  
  16. # Convert to numpy array. "test" is the field name
  17. field = arcpy.da.TableToNumPyArray (fc, "test", skip_nulls=True)
  18. sum = field["test"].sum()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement