Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- summed_total = 0
- with arcpy.da.SearchCursor(fc, "field to be totaled") as cursor:
- for row in cursor:
- summed_total = summed_total + row[0]
- summed_total = 0
- field = "field to be summed"
- with arcpy.SearchCursor(fc):
- for row in cursor:
- summed_total = summed_total + row.GetValue(field)
- import arcpy, numpy
- fc = r'C:pathtoyourfc'
- # Convert to numpy array. "test" is the field name
- field = arcpy.da.TableToNumPyArray (fc, "test", skip_nulls=True)
- sum = field["test"].sum()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement