操作方法
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')
option to select records with odd values in the numeric field.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')
文章 ID: 000026383
获取来自 ArcGIS 专家的帮助
立即开始聊天