Delete Identical (Data Management)

Summary

Deletes records from a feature class or table that have identical values in a set of fields. If the geometry field is selected, feature geometries are compared.

The Find Identical tool can be used to report which records are considered identical without deleting them.

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.

  • For every set of identical records, the tool deletes all but the first of the identical records. The order of the identical records will be in the same order as returned by the Find Identical tool.

  • The values from multiple fields in the input dataset are compared. If more than one field is specified, records are matched by the values in the first field, then by the values of the second field, and so on.

  • With feature class or feature layer input, use the geometry field in the Field(s) parameter to compare feature geometries to find identical features by location. The XY Tolerance and Z Tolerance parameters are only valid when the geometry field is selected as one of the input fields.

Parameters

LabelExplanationData Type
Input Dataset

The table or feature class that will have its identical records deleted.

Table View
Field(s)

The field or fields whose values will be compared to find identical records.

Field
XY Tolerance
(Optional)

The x,y tolerance that will be applied to each vertex when evaluating whether there is an identical vertex in another feature.

Linear Unit
Z Tolerance
(Optional)

The z-tolerance that will be applied to each vertex when evaluating whether there is an identical vertex in another feature.

Double

Derived Output

LabelExplanationData Type
Updated Input Dataset

The updated input dataset.

Table View

arcpy.management.DeleteIdentical(in_dataset, fields, {xy_tolerance}, {z_tolerance})
NameExplanationData Type
in_dataset

The table or feature class that will have its identical records deleted.

Table View
fields
[fields,...]

The field or fields whose values will be compared to find identical records.

Field
xy_tolerance
(Optional)

The x,y tolerance that will be applied to each vertex when evaluating whether there is an identical vertex in another feature.

Linear Unit
z_tolerance
(Optional)

The z-tolerance that will be applied to each vertex when evaluating whether there is an identical vertex in another feature.

Double

Derived Output

NameExplanationData Type
out_dataset

The updated input dataset.

Table View

Code sample

DeleteIdentical example 1 (Python window)

The following Python window script demonstrates how to use the DeleteIdentical function in intermediate mode.

import arcpy
arcpy.management.DeleteIdentical("C:/data/fireincidents.shp", ["ZONE", "INTENSITY"])
DeleteIdentical example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the DeleteIdentical function to identify duplicate records of a table or feature class.

# Name: DeleteIdentical_Example2.py
# Description: Delete identical features in a dataset based on Shape (geometry) and a TEXT field.

# Import system modules
import arcpy

arcpy.env.overwriteOutput = True

# Set workspace environment
arcpy.env.workspace = "C:/data/sbfire.gdb"

# Set input feature class
in_dataset = "fireincidents"

# Set the field on which the identical records are found
fields = ["Shape", "INTENSITY"]

# Set the XY tolerance within which identical records will be deleted
xy_tol = "0.02 Miles"

# Set the Z tolerance to default
z_tol = ""

# Run Delete Identical 
arcpy.management.DeleteIdentical(in_dataset, fields, xy_tol, z_tol)