Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID'))
- with arcpy.da.UpdateCursor(fc, ['QUANTITY_SOLID_SUM']) as cursor:
- for row in cursor:
- row[0] = b
- cursor.updateRow(row)
- import arcpy
- # Define the feature class
- fc = r'C:pathtoyourfc'
- # Use a generator expression to populate a list from the 'QUANTITY_SOLID' field
- b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID'))
- with arcpy.da.UpdateCursor(fc, ['QUANTITY_SOLID_SUM']) as cursor:
- for row in cursor:
- row[0] = b
- cursor.updateRow(row)
Add Comment
Please, Sign In to add comment