I am trying to calculate new records in several fields by looping through each field in a list and dividing the value of each record by its shape area. My code is as follows:
inFeature = outFeature my_list = ['a', 'b', 'c'] divfield = "Shape_Area" with arcpy.da.UpdateCursor(inFeature, my_list) as cursor: for row in cursor: for n in range(len(my_list)): row[n] = row[n] / row[divfield] cursor.updateRow(row)
I am getting the error: TypeError: list indices must be integers, not str
All of my fields are stored as double.