For a while I've been using boxplot and definition query in ArcGIS to eliminate data outliers. It is a painful process when dealing with a lot of files and difficult to ensure the consistency.

I don't know much python but I want to try something like replacing outliers as `Null` in python parse of field calculator:

`def function(x):`

qnt = quantile(x, probs=c(.25, .75));

H = 1.5 * IQR(x);

y=x;

y[x < (qnt[1] - H)] = "";

y[x > (qnt[2] + H)] = "";

return y

Then output in my new field function`( !Yield_kg__! )` but it turns out failure below:

` ERROR000539:Error running expression: function(0.0)`

Traceback (most recent call last)

File "<expression>", line1, in <module>

File "<string>', line2, in function

NameError: globe name 'quantile' is not defined

Can anyone tell me how to fix this?

numpy has a percentile, ergo, you can determine quantiles.... a function which you haven't defined, or indicated it's source.

Now you can put this into a function, simply by importing numpy, reading the column, classifying your values if you want