Last active
August 29, 2015 14:17
-
-
Save cindygis/8b77c2977a9434df9258 to your computer and use it in GitHub Desktop.
Gets the difference between two lists of SGs and applies a feature selection containing the difference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drak = [row[0] for row in arcpy.da.SearchCursor("DSG", "SG21Code")] | |
sga = [row[0] for row in arcpy.da.SearchCursor("SGA", "SGA.ID")] | |
lr_diff = lambda l, r: list(set(l).difference(r)) | |
rest = lr_diff(sga, drak) | |
qry = """ SGA.ID IN (\'""" + "\', \'".join(rest) + "\')" | |
arcpy.management.SelectLayerByAttribute("SGA","NEW_SELECTION", qry) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment