---- Topic: Query and summarize revisited ----
This post https://community.esri.com/thread/171629 brought up the sometimes difficult task of finding information within tabular data. As usual, there are many ways to do the same thing... this is but one.
Pre-tasks: Use TableToNumPyArray to convert your tabular information into an array. It is pretty fool-proof
TableToNumPyArray—Help | ArcGIS for Desktop
The trick to remember is that each record in an array is treated as unique unless found otherwise. This makes it particularly easy to sort records on multiple columns and summarize and/or extract what you need from within. In this example, I concentrated on printing.
I used a simple list comprehension to show how to pull the records out according to the first column which we can treat as a class field. Once the classes were determined the list comprehension grouped the data into the classes and each class could have further information extracted/summarized.
The output produced can be expanded upon. Should want to partition the data into separate datasets, you can do it while it is into array form. Hope you get some ideas on breaking down problems into its constituent parts and using the tools available to you. For ArcGIS Pro, the new python suite, contains Pandas which provides an other alternate to the same process.
I am also sure that someone can come up with an sql statement that does some...but not all of the tasks outlined here.
Summarizing data |
---|
Now for some output
|
NOTE:
A pdf version was added. It contains more commentary on the process. A second example was added on 2015-02-18
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.