1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Rep Power

    Printing the different values from a database field

    I am relatively new to python but have worked with file and personal geodatabases in the ESRI environment for several years, and now Im trying to combine the two. I have a database that contains 72 features or rows. One of the fields (FACILITY_ID2) is populated with one of three different values. I have used a for loop to print out all the values from this field, but is there a way to just print the different values... meaning my result would have three lines, one example of each of the different values in the field?

    heres the simple code I have so far:
    import arcpy
    fc = arcpy.SearchCursor("FACILITY_ENERGY", "", "", "FACILITY_ID2", "")
    for values in fc:
    	print values.FACILITY_ID2
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Try the set data type.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo