I have a feature class that has a field of unique ID numbers. I would like to create an array of these numbers so I can loop over them in ArcPy. Any ideas?
If you have Arc 10.1 or above, I'd use an arcpy.da cursor. Also specify just the field(s) you want.
myLayer = 'YourLayer' myField = 'YourField' myList = [row for row in arcpy.da.SearchCursor(myLayer, myField)]