>>> 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")
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.