Hi everyone,

I was wondering if there was some code to calculate the range of several columns of short integer data in an attribute table. I have a dataset of polygons where sometimes as much as three different observers rank the polygons according to different criteria. I need to calculate the range of scores in each polygon as a way to examine scoring differences between observers, but I'm not sure the steps to take in Arc to do this.

Thanks for your help.

Tom

I was wondering if there was some code to calculate the range of several columns of short integer data in an attribute table. I have a dataset of polygons where sometimes as much as three different observers rank the polygons according to different criteria. I need to calculate the range of scores in each polygon as a way to examine scoring differences between observers, but I'm not sure the steps to take in Arc to do this.

Thanks for your help.

Tom

edit: misread problem.

Yes. That would really help. Thanks.

Give this a whirl.

I haven't tested this but it *should* work.

I'm not sure this tool will work as I believe it will return those statistics for values in a single column, not across multiple columns. I could be mistaken though.

Min (for max, change "<" to ">"):

Sure, there's a lot you can do in the Field Calculator, but the OP is asking about how to do this with python, presumably in a script, for automating the calculation of such things, rather than forcing a situation where one has to interact with the data every time something like this might be done. Also, your example doesn't return the range, just the minimum value present in the array?

A range is a min and max. I gave the code to find those. Do I need to give a formula to find the difference?

Also, the OP asked for "the steps to take in Arc to do this". This is how I'd do it. Many people post in the python forum asking for a solution that might be solved in a method other than using python.

Sorry if i sounded snarky in my response (snark begets snark apparently). I guess I assume that if someone is asking a question in a python forum that the desired solution is a python one. I can see how that might not always be the case, and alternatives are always good to see.

As for the rest, a range is not the min and max but the difference between those, so yes, i think if someone is asking how to obtain that value, then you would want to provide a complete solution.