deltacube2 for key value in zcube2dict items if func1 key key if func1

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