I have a script that is supposed to update several fields based on the values of several other associated fields. My script is almost working as it should. However, it is overwriting my "High" and "Medium" values with "Low" despite my conditional statement. Any suggestions of where I am going wrong?
# fill polygons with "Medium", but do not overwrite those already filled with "High"
for species, primary in zip(SGCN_list, primary_habitat):
if species not in (f.name for f in arcpy.ListFields(SGCN_FC)):
pass
elif primary is None:
pass
else:
with arcpy.da.UpdateCursor(SGCN_FC, [species, primary]) as cursor:
for row in cursor:
if row[1] is not None: # if record is already populated with "High"
pass
elif row[1] >= 0.10:
row[0] = "Medium"
else:
pass
cursor.updateRow(row)
# fill polygons with Low
for species, secondary in zip(SGCN_list, secondary_habitat):
if species not in (f.name for f in arcpy.ListFields(SGCN_FC)):
pass
elif secondary is None:
pass
else:
with arcpy.da.UpdateCursor(SGCN_FC, [species, secondary]) as cursor:
for row in cursor:
if row[1] is not None: # if record is already populated with "High" or "Medium"
pass
elif row[1] >= 0.10:
row[0] = "Low"
else:
pass
cursor.updateRow(row)