Dividing all records by mean value in python script/field calculator

Discussion created by sears.alexandra_EPA on May 7, 2013
Latest reply on May 7, 2013 by sears.alexandra_EPA
I am very new to python scripting. I need to be able to run this function through python to use on multiple different datasets. Basically, I am trying to multiply an attribute column by a factor of the mean of that column depending on the ratio of that attribute to the mean.

This is what I've got so far:

expression = fuzExp(H_Income_M)

codeblock = """def fuzExp(H_Income_M)
if (H_Income_M) <= (MEAN*2):
return (1/MEAN)*H_Income_M
return 1"""

I've also calculated the mean in a summary statistic table. I'm just looking for a way to get the mean value into the above function.

Any help would be greatly appreciated!!!