Reclassify Field (Data Management)

Summary

Reclassifies values in a numerical or text field into classes based on bounds defined manually or using a reclassification method.

Illustration

Reclassify Field tool illustration
A continuous variable is reclassified into discrete classes with equal intervals.

Usage

    Caution:

    This tool modifies the input data. See Tools that modify or update the input data for more information and strategies to avoid undesired data changes.

  • This tool accepts feature classes or table views as the input and modifies the input data.

  • The tool supports the following eight reclassification methods:

    • Defined interval—Each class will span the range of the Interval Size parameter value, starting with the minimum value in the field. For example, if the interval size is 10, and the minimum value is 244, the first class will include the values between 244 and 254. This method is recommended if a particular interval size is needed, for example, when reclassifying temperature values using a 10-degree range.
    • Equal interval—Each class will have the same range, and the size of the range will be defined by the Number of Classes parameter value. For example, if the number of classes is five, and the range is 0 to 100, the first class will include the values between 0 and 20. Similar to Defined interval, this method is recommended if the intervals are meaningful and also if a specific number of classes are expected. For example, you want to reclassify temperature into exactly five classes of equal range.
    • Geometric interval—The range of each class increases or decreases geometrically (allowing to change direction once) defined by the Number of Classes parameter. This method attempts to find natural groupings in the data while keeping the class ranges approximately equal.
    • Manual interval—The upper bounds and reclassed value of each class is specified in the Reclassification Table parameter. The reclassed value can be numeric or text and will create an output field of the same type. If both text and numbers are provided for reclassed values, the output field will be text. This method can be useful when none of the class breaks in the other methods are appropriate, or you want to label the classes with text instead of integers.
    • Natural breaks (Jenks)—Class breaks are created around natural groupings in the data with the Jenks Natural Breaks algorithm defined by the Number of Classes parameter. This method groups similar values and maximizes differences between classes. This method is useful when meaningful intervals are not present in the data, and you want to find the optimal groupings. For example, population count by city may have natural groupings.
    • Quantile—Classes include an equal number of values in each of the specified Number of Classes parameter values. For example, if there are 50 values and the number of classes is five, each class will have 10 records. This method is useful when you want to understand where each value falls in the ranked values. For example, you want to understand the locations in which average annual income falls in the top and bottom of 10 quantiles.
    • Standard deviation—Class ranges are created using a number of standard deviations above and below the average, specified in the Number of Standard Deviations parameter. This is useful to understand where values lie in a distribution. For example, you can reclassify rainfall by one standard deviation to identify areas with rainfall greater than two standard deviations from the mean.
    • Unique values—Each unique value in a text field becomes a class. This may be useful if you need to use categories from a text field in a tool that requires a numeric field. For example, you want to convert alphanumerical county codes to integers.

  • When choosing the classification method, consider the type of data and how you are going to use the reclassified values. Not all methods can be used for all applications. For example, to reclassify more than one field and use them together in analysis workflows, use a technique that is consistent between data, such as quantile, rather than one that varies, such as natural breaks (Jenks).

  • Checking the Reverse Values (Descending) parameter (reverse_values = "DESC" in Python) will reverse the integer classes so that the class with the lowest values is reclassified as the highest class.

  • The quantile reclassification method creates classes in which each class contains the same number of records. However, if the Number of Classes parameter value does not divide evenly into the number of records, the remainder will be divided into each class in ascending order.

  • For the manual interval method, at least one of the upper bound values specified must be greater than the minimum value in the field to reclassify. Any values in the field that are greater than the maximum specified upper bound will be reclassified as -9999.

  • For the defined interval method, the Interval Size parameter value must be small enough that at least three classes are created.

  • None of the reclassification methods use sampling schemes. You can obtain the range of each class from other classification methods that use sampling, such as graduated symbology.

  • The tool creates fields representing the class and range of each record, which are prefixed with the Output Field Name parameter value. The class field is an ascending or descending integer field, and the range field displays the range of values for each field. If the field to reclassify is a text field, only the class field will be created. If the reclassification method is manual and no reclassed values are specified, only the range field will be created.

  • A reclassification table is displayed in the geoprocessing messages showing the upper bound and reclassed value of each class.

Parameters

LabelExplanationData Type
Input Table

The input table or feature class containing the field that will be reclassified.

Table View; Raster Layer; Mosaic Layer
Field to Reclassify

The field that will be reclassified. The field must be numeric or text.

Field
Reclassification Method
(Optional)

Specifies the reclassification method that will be used for field values in the Field to Reclassify parameter value.

  • Defined interval Classes will be created with the same class range over the span of the values of the field to reclassify.
  • Equal intervalClasses will be created with equal class ranges divided into a specified number of classes. This is the default.
  • Geometric intervalClasses will be created with geometrically increasing or decreasing class ranges into a specified number of classes.
  • Manual interval Class breaks and reclassed values will be manually specified.
  • Natural breaks (Jenks) Classes will be created of natural groupings in the data using the Jenks natural breaks algorithm.
  • Quantile Classes will be created in which each class includes an equal number of values.
  • Standard deviation Classes will be created by adding and subtracting a fraction of the standard deviation above and below the average value.
  • Unique valuesClasses will be created in which each unique value of the field becomes a class.
String
Number of Classes
(Optional)

The target number of classes in the reclassified field. The maximum number of classes is 256.

Long
Interval Size
(Optional)

The class interval size for the reclassified field. The provided value must result in at least 3 classes and not more than 1,000 classes.

Double
Number of Standard Deviations
(Optional)

Specifies the number of standard deviations that will be used for the reclassified field. Class breaks and categories will be created with equal interval ranges that are a proportion of the standard deviation from the mean.

  • One standard deviationIntervals will be created using one standard deviation. This is the default.
  • One half of a standard deviationIntervals will be created using half of one standard deviation.
  • One third of a standard deviationIntervals will be created using a third of one standard deviation.
  • One quarter of a standard deviationIntervals will be created using a quarter of one standard deviation.
String
Reclassification Table
(Optional)

The upper bound and reclassed value for the manual reclassification method.

Value Table
Reverse Values (Descending)
(Optional)

Specifies how the reclassified values will be ordered.

  • Checked—Classes will be assigned values in descending order; the class with the highest values is assigned 1, the next highest class is assigned 2, and so on.
  • Unchecked—Classes will be assigned values in ascending order; the class with the lowest values is assigned 1, the next lowest class is assigned 2, and so on. This is the default.

Boolean
Output Field Name
(Optional)

The name or prefix of the output field. If the field to reclassify is a numerical field, two fields will be created, and this name will prefix the field names. If the field to reclassify is a text field, one new field will be created with this name.

String

Derived Output

LabelExplanationData Type
Updated Input Table

The updated table that contains the reclassified fields.

Table View

arcpy.management.ReclassifyField(in_table, field, {method}, {classes}, {interval}, {standard_deviations}, {reclass_table}, {reverse_values}, {output_field_name})
NameExplanationData Type
in_table

The input table or feature class containing the field that will be reclassified.

Table View; Raster Layer; Mosaic Layer
field

The field that will be reclassified. The field must be numeric or text.

Field
method
(Optional)

Specifies the reclassification method that will be used for the field values in the field parameter value.

  • DEFINED_INTERVAL Classes will be created with the same class range over the span of the values of the field to reclassify.
  • EQUAL_INTERVALClasses will be created with equal class ranges divided into a specified number of classes. This is the default.
  • GEOMETRIC_INTERVALClasses will be created with geometrically increasing or decreasing class ranges into a specified number of classes.
  • MANUAL Class breaks and reclassed values will be manually specified.
  • NATURAL_BREAKS Classes will be created of natural groupings in the data using the Jenks natural breaks algorithm.
  • QUANTILE Classes will be created in which each class includes an equal number of values.
  • STANDARD_DEVIATION Classes will be created by adding and subtracting a fraction of the standard deviation above and below the average value.
  • UNIQUE_VALUESClasses will be created in which each unique value of the field becomes a class.
String
classes
(Optional)

The target number of classes in the reclassified field. The maximum number of classes is 256.

Long
interval
(Optional)

The class interval size for the reclassified field. The provided value must result in at least 3 classes and not more than 1,000 classes.

Double
standard_deviations
(Optional)

Specifies the number of standard deviations that will be used for the reclassified field. Class breaks and categories will be created with equal interval ranges that are a proportion of the standard deviation from the mean.

  • ONEIntervals will be created using one standard deviation. This is the default.
  • HALFIntervals will be created using half of one standard deviation.
  • THIRDIntervals will be created using a third of one standard deviation.
  • QUARTERIntervals will be created using a quarter of one standard deviation.
String
reclass_table
[reclass_table,...]
(Optional)

The upper bound and reclassed value for the manual reclassification method.

Value Table
reverse_values
(Optional)

Specifies the order of the reclassified values.

  • DESCClasses will be assigned values in descending order; the class with the highest values is assigned 1, the next highest class is assigned 2, and so on.
  • ASCClasses will be assigned values in ascending order; the class with the lowest values is assigned 1, the next lowest class is assigned 2, and so on. This is the default.
Boolean
output_field_name
(Optional)

The name or prefix of the output field. If the field to reclassify is a numerical field, two fields will be created, and this name will prefix the field names. If the field to reclassify is a text field, one new field will be created with this name.

String

Derived Output

NameExplanationData Type
updated_table

The updated table that contains the reclassified fields.

Table View

Code sample

ReclassifyField example 1 (Python window)

The following Python window script demonstrates how to use the ReclassifyField function.


arcpy.management.ReclassifyField("Demographics", "Population", 
      "EQUAL_INTERVAL", 10, None, "", None, None, "Population_EQUAL_INTERVAL")
ReclassifyField example 2 (stand-alone script)

The following stand-alone Python script demonstrates how to use the ReclassifyField function.


# Import system modules.
import arcpy

try:
    # Set the workspace and input features.
    arcpy.env.workspace = r"C:\\Reclassify\\MyData.gdb"
    in_table = "Demographics"

    # Set the input field that will be reclassified
    field = "Population"

    # Set the reclassification method
    method = "MANUAL"

    # Set the reclassification table
    reclass_table = "10000 Village;100000 Town;1000000 City"

    # Set the output field name
    output_field_name = "SettlementType"

    # Run the Reclassify Field tool
    arcpy.management.ReclassifyField(in_table, field, method, "", 
          None, "", reclass_Table, None, output_field_name)

except arcpy.ExecuteError:
    # If an error occurred when running the tool, print the error message.
    print(arcpy.GetMessages())

Environments

Related topics