Field Calculator Null Values

390
3
08-07-2013 04:02 AM
OswaldoBarrera_Martin
New Contributor
Hi

I am trying to calculate the incomplete gamma function using Python. For now, the only way that I have found to do this is by using the library "mpmath". Particularly, the "mpmath.gammainc" function works perfectly in the Python window but when I try to implement this function in the field calculator it gives "Null" values.

This is the code I am using:

def H(a):
import mpmath
b=mpmath.gammainc(a,0)
return b

Is there any solution for solving this problem? Is there any alternative method for calculating the incomplete gamma function?

Many thanks in advance

Oswaldo
Tags (2)
0 Kudos
3 Replies
JimCousins
MVP Regular Contributor
Do you have a correct field type to receive the output?
0 Kudos
DanPatterson_Retired
MVP Emeritus
0 Kudos
OswaldoBarrera_Martin
New Contributor
Do you have a correct field type to receive the output?


I have tried with Float, Double and integers. In all the cases, the "null" value was the output

thanks
0 Kudos