HOW TO
In ArcGIS Pro, it is possible to select specific records containing odd or even numbers from a numeric field in the attribute table using Python.
The following image shows the example of records for selected odd numbers from a numeric field.
arcpy.management.SelectLayerByAttribute('<Feature layer>', 'SUBSET_SELECTION', 'MOD ("<Field name>", 2) = 0')
Alternatively, in the Python window, insert the following command to select records with odd values in the numeric field:
arcpy.management.SelectLayerByAttribute('<Feature layer>', 'SUBSET_SELECTION', 'MOD ("<Field name>", 2) = 1')
To use both Python commands consecutively, insert the following command to remove the previous selection before selecting new records or click the Clear option in the Selection group:
arcpy.management.SelectLayerByAttribute('<Feature layer>', 'CLEAR_SELECTION')
Unterstützung durch ArcGIS-Experten anfordern
Esri Support App herunterladen