ArcNumerical TBX: Standardize Fields and Other Tools

2571
4
03-27-2016 05:15 PM

ArcNumerical TBX: Standardize Fields and Other Tools

Hey All,

This toolbox started out as an experiment using Pandas in ArcGIS but I have decided to include any scripting tools that leverage numpy/pandas to this distribution.

Tools in Distribution:

Add Z Scores Tool: This 10.4 ArcGIS scripting tool is designed to take selected fields and create an added field with a Z score for each one of the selected fields. The script essential exports a table to a numpy array, then to a dataframe, and then uses pandas to calculate new columns with corresponding Z Scores for the fields selected.
Add Grouping Fields: TBD
Feedback appreciated!
Test.jpg

Parameter Outline

ParameterExplanationData Type
Input_Feature_ClassDialog Reference

This is the selected input feature class that will have new fields with Z scores calculated joined to it. If the fields already exist, they will be updated by the tool.


Python Reference

The feature class uses the ExtendTable function used from the DA module of arcpy to join a modified structured numpy array with column-wise calculated Z scores joined to it.

Feature Layer
Fields_to_StandarizeDialog Reference

These are the fields that will have their Z scores calculated within a Pandas data frames, converted to a structured numpy array, and then joined to the input feature class based on the object ID. The fields added will be in the form of "Zscore_"+%FieldName%. If a field of that form already exists in the table, it will be updated.


Python Reference

Generally the fields are selected from the feature class to be converted into a numpy array, then into a pandas data frame, then back to structured numpy array to be joined based on the object ID. This tool assumes there is an object ID to use to join to.

Multiple Value

Download on Github:GitHub - Holisticnature/ArcNumerical-Tools: The goal of this script is to add new fields with standa...

Comments

David, add numpy to your tags since the root of pandas are native numpy arrays.  If you have interest in 'panda-izing' other stuff, NumPy Repository​ is where you may find some materials of interest to you. send me a request

Hey Dan,

I just asked to join the group! I will change the tag. I have used numpy/pandas interchangeably, but I have always liked the representation and syntax of pandas data frames. Look forward to the discussions in the new group! Thanks!

I responded... anything you want to contribute... or correct... please feel free to post and/or share there.  I have steered clear of pandas writing because of the large python 2.7/arcmap 10.x clientel.  PRO will change that and esri is using reasonable new incarnations of python, numpy and the scipy stack.

I was thinking about making a version of the script that just used numpy, but this was largely just to explore applications and useful ArcGIS connections (moving between data structures etc). I think as people move to 10.4 this will be more useful. I just wanted to start working with them more because I was very excited for arcpy's integration with the scipy stack.

Version history
Last update:
‎03-27-2016 05:15 PM
Updated by:
Contributors