I have a large dataset where I need to run a lot of calculations. it contains roughly 100 fields. I have created a script that runs an update cursor to calculate some new fields based on a few other fields. Well I am running into the problem where if there is a zero in the field that is a divisor, I get this error:
I am looking for how to construct an if statement that will first determine if the calculation will create this error, then if it does, it will make the value 0
my first try of this:
did not work. Any help on how to make this if statement work would be much appreciated!!! Thanks in advance!!
Clinton
Code:
Runtime error
Traceback (most recent call last):
File "<string>", line 36, in <module>
ZeroDivisionError: float division by zeromy first try of this:
Code:
if ((row[32]/row[3])/(row[30]/row[3]) =0):
row[84]= (row[32]/row[3])/(row[30]/row[3])
else:
row[84]= 0Clinton