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

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    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:
    Code:
    import arcpy
    fc = arcpy.SearchCursor("FACILITY_ENERGY", "", "", "FACILITY_ID2", "")
    for values in fc:
    	print values.FACILITY_ID2
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    Try the set data type.
    set('aaaab')==set('ab')
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo