I want to run an update cursor that operates on a couple of conditions as in the following:
with arcpy.da.UpdateCursor(fc,field_list) as cursor:
for rec in cursor:
if rec[0] == 'some value' AND (rec[1]+rec[2] > 9):
rec[4] = 'updated value'
cursor.updateRow(rec)
essentially, I need to update records for specific values in one field when the sum of two others are at least 1.
However, I keep getting a syntax error at the AND statement.
Bonus points if you have thoughts about looping through multiple conditions being fed into this - for instance, I have 4 different conditions to update in the 'rec[0] ' field, each of which has a set of conditions to meet and an 'else' result. Can this be done with a dictionary perhaps?