Solved! Go to Solution.
I'd probably use an update cursor to evaluate the value of the field, then delete the row if it the field value equals 1. If you need some starter code let me know.
import arcpy from arcpy import env env.workspace = #"put the file path to the folder your shapefile is in here as a string" cursor = arcpy.da.UpdateCursor(#"shapefile name" , "Field name that has the 1's and 0's") for row in cursor: if row[0] == 1: cursor.deleteRow() del row del cursor
import arcpy from arcpy import env env.workspace = #"put the file path to the folder your shapefile is in here as a string" cursor = arcpy.da.UpdateCursor(#"shapefile name" , "Field name that has the 1's and 0's") for row in cursor: if row[0] == 1: cursor.deleteRow() del row del cursor
I'd make a copy of your shapefile first to test this on, there is no way to undo the delete row, so I would test it on the copy before applying it to the actual file.
Use arcpy.SelectLayerByAttribute_management then arcpy.DeleteFeatures_management
Code examples are in the help:
http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000071000000
http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000036000000