rgthurau

If statement won't bypass zeros

Discussion created by rgthurau on Nov 23, 2011
Latest reply on Dec 8, 2011 by rgthurau
Hello,
Trying to calculate fields using some division. Of course, division by zero is bad. Created what I thought was a simple if statement to skip zeros:

rows2 = arcpy.SearchCursor(parcels)
for row2 in rows2:
    land_area = row2.getValue("Land_Area")
    if land_area > 0:
        arcpy.CalculateField_management(parcels, "UTC10_Pct", """[UTC10_Ft]/[Land_Area] """, "VB")


Overflow Error

I know I can get around this using a selection, but seems like should simply run from Python.
Can anyone tell why this isn't working?

Thanks
Rich

Outcomes