New answers tagged

1

It has been a while since I post this question. The script has been updated since then and I post my answer in the following part for other users. list = [] rows = arcpy.SearchCursor(bufferclip) SumArea = bufferclip + "Area" for row in rows: area = row.getValue("Shape_Area") list.append(area) SumArea = sum(list) print SumArea arcpy....


5

Use a dictionary: The main operations on a dictionary are storing a value with some key and extracting the value given the key. d = {1:"Lightning", 2:"Equipent use", ... } with arcpy.da.UpdateCursor(fc, ["CAUSE_TEXT", "CAUSE"]) as cursor: for row in cursor: if row[1] in d: #Check if value of row[1] exists in dictionary row[0] = ...


Top 50 recent answers are included