deltacube1 for key value in zcube1dict items if func1 key key if func1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
deltacube1 = 0.0
for key, value in zcube1dict.items():
if (func1(key[0], key[1]) == 0):
if ((func1(key[0], key[1]) - value) == 0):
deltacube += 0.0
else:
print "denom is zero but nom is not zero: ", (func1(key[0], key[1]) - value)
else:
deltacube += np.fabs((func1(key[0], key[1]) - value)/func1(key[0], key[1]))
deltacube1 = deltacube1/len(zcube1dict)