Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In ArcMap, the right-click Summarize option very quickly creates a frequency listing of the chosen field:

summarize

enter image description here

Note that the count field shows the count of duplicate values. How can I access this using ArcPy?

Is it possible to access ArcGIS's table operations "Summarize..." and "Statistics..." in python? suggests using Summary Statistics, but I can't get any meaningful output from this tool. Instead, it always just lists the total count of features, rather than the frequency of each individual value:

enter image description here

How can I achieve the result from the second screenshot above, using ArcPy in ArcMap 10.0 with an ArcEditor license (whereby I can't run the FREQUENCY command)?

Dan Patterson's script applies to ArcGIS 9.3 so (probably) isn't useful?

share|improve this question
    
Dan Patterson is awesome, had him for a teacher in Uni. –  TForward Oct 8 '12 at 3:59
    
He's been on my list of "GIS people to buy a beer" for years –  Stephen Lead Oct 8 '12 at 4:02
add comment

1 Answer

up vote 5 down vote accepted

I think you need to include a Case Field. If you do not see this on the tool dialog, be sure to increase its size or use the slider bar on the right hand side to see it.

From Summary Statistics help:

"If a Case field is specified, statistics will be calculated separately for each unique attribute value. The Output Table will contain only one record if no Case field is specified. If one is specified, there will be one record for each Case field value."

share|improve this answer
1  
d'oh - RTFM on that one. Thanks for the help. –  Stephen Lead Oct 8 '12 at 4:15
    
Until I discovered Summary Statistics I could not imagine how to do without Frequency. –  PolyGeo Oct 8 '12 at 4:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.