[GIS] Frequency, summarize tool options of ArcGIS for Desktop

arcgis-desktoparcpystatistics

I'm looking for some general frequency, summarize tool.
What I basically want is some tool like the summarize tool in ArcGIS (right click in the attribute table> summarize) that runs on all attributes and objects that I select (it would be great if that tool could output to excel for example but that is totally optional).
I have way to many objects and attributes to use do this manually…

I know this should be possible to create with ArcPy (although I don't find summarize in Arcpy), but this looks like something that can be useful to a lot of people so I believe something like this must already exist? ArcGIS is no requirement, if it runs on shape files or anything I can export to, that's fine.

If this does not exist, then I will try to develop it myself and maybe post it somewhere online cause it looks like something useful.

EDIT: I've written a small tool in python to basically do summarize. It works on shape files and summarizes to Excel (but other formats are easy to use too) and should be OS independent. If anyone would like to see it I will clean the code up and publish it.

EDIT2: The tool can be found here: https://bitbucket.org/tcoopman/shapesummarize/

Best Answer

What about the Summary Statistics tool? (Updated 2015-11-05)

Available statistics types are:

  • SUM—Adds the total value for the specified field.
  • MEAN—Calculates the average for the specified field.
  • MIN—Finds the smallest value for all records of the specified field.
  • MAX—Finds the largest value for all records of the specified field.
  • RANGE—Finds the range of values (MAX minus MIN) for the specified field.
  • STD—Finds the standard deviation on values in the specified field.
  • COUNT—Finds the number of values included in statistical calculations. This counts each value except null values. To determine the number of null values in a field, use the COUNT statistic on the field in question, and a COUNT statistic on a different field which does not contain nulls (for example, the OID if present), then subtract the two values.
  • FIRST—Finds the first record in the Input Table and uses its specified field value.
  • LAST—Finds the last record in the Input Table and uses its specified field value.

...and it's callable from Python:

import arcpy
from arcpy import env
env.workspace = "C:/data/Habitat_Analysis.gdb"
arcpy.Statistics_analysis("futrds", "C:/output/output.gdb/stats", [["Shape_Length", "SUM"]], "NM")
Related Question