>>> x [4, 4, 1, 2, 2, 3] >>> list(set(x)) [1, 2, 3, 4] >>>
fc = "Rivers_USA" list = [] outList = [] # append values to list rows = arcpy.SearchCursor(fc) for row in rows: list.append(row.System) del row, rows # create unique list by removing duplicates for n in list: if n not in outList: outList.append(n) # create layer files for n in outList: arcpy.MakeFeatureLayer_management(fc, "River_" + n, "\"SYSTEM\" = " + "'" + n + "'") arcpy.SaveToLayerFile_management("River_" + n, r"C:\temp\python\River_" + n + ".lyr")
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.