Summarize Percent Change (Crime Analysis and Safety)

Summary

Calculates the percent change for features that correspond with point features representing two equal comparison time periods.

Usage

  • The Input Current Period Point Features and Input Previous Period Point Features parameter values can be created by performing date and time selections on a larger dataset and saving the selections to new layers.

  • The following fields will be added to the output:

    • CUR_CNT—The number of points from the Input Current Period Point Features parameter values that are coincident with the Input Features parameter values.
    • PREV_CNT—The number of points from the Input Previous Period Point Features parameter values that are coincident with the Input Features parameter values.
    • DIFF_CNT—The difference between the CUR_CNT and PREV_CNT fields.
    • PERC—The percentage of change between the CUR_CNT and PREV_CNT fields. This is calculated using the formula
      ((C - P) / P) * 100
      where C is the current count and P is the previous count. If the previous count is 0, the percent change value is null. When the percent change value is null, these features are designated as no percentage in output symbology classification.

Parameters

LabelExplanationData Type
Input Features

The coincident features from which comparison time periods will be counted and compared.

Feature Layer
Input Current Period Point Features

The point features filtered to the most recent comparison time period.

For example, you can filter for crimes from the previous 14 days.

Feature Layer
Input Previous Period Point Features

The point features filtered to the time period immediately preceding the current period. This time period must be of equal length to the current period to provide an accurate comparison.

For example, if the current period contains features from January 15 to January 28, the previous period contains features from January 1 to January 14.

Feature Layer
Output Feature Class

The output feature class containing difference counts and percent change calculations for the time period comparison.

Feature Class
Search Radius
(Optional)

The maximum distance from the Input Features parameter value that a point feature will be considered coincident.

This parameter is only active when point or line features are used as the input features.

Linear Unit

arcpy.ca.SummarizePercentChange(in_features, in_current_features, in_previous_features, out_feature_class, {search_radius})
NameExplanationData Type
in_features

The coincident features from which comparison time periods will be counted and compared.

Feature Layer
in_current_features

The point features filtered to the most recent comparison time period.

For example, you can filter for crimes from the previous 14 days.

Feature Layer
in_previous_features

The point features filtered to the time period immediately preceding the current period. This time period must be of equal length to the current period to provide an accurate comparison.

For example, if the current period contains features from January 15 to January 28, the previous period contains features from January 1 to January 14.

Feature Layer
out_feature_class

The output feature class containing difference counts and percent change calculations for the time period comparison.

Feature Class
search_radius
(Optional)

The maximum distance from the in_features parameter value that a point feature will be considered coincident.

This parameter is only enabled when point or line features are used as the input features.

Linear Unit

Code sample

SummarizePercentChange example 1 (Python window)

The following Python window script demonstrates how to use the SummarizePercentChange function in immediate mode.

import arcpy
arcpy.env.workspace = r"C:\data\city_pd.gdb"
arcpy.ca.SummarizePercentChange("Precincts", "crimes_q3", "crimes_q2",
                                "crimes_percent_change_by_precinct_q2_to_q3")
SummarizePercentChange example 2 (stand-alone script)

The following Python script demonstrates how to use the SummarizePercentChange function in a stand-alone script.

# Name: SummarizePercentChange.py
# Description: Compare the number of crimes committed in the second quarter to 
#              the third quarter by precincts, and determine the percent 
#              change.

# import system modules 
import arcpy

# Set environment settings
arcpy.env.workspace = r"C:\data\city_pd.gdb"

# Run SummarizePercentChange
arcpy.ca.SummarizePercentChange("Precincts", "crimes_q3", "crimes_q2",
                                "crimes_percent_change_by_precinct_q2_to_q3")