I want to use arc py and the search cursor tool to display values from a field in my attribute table called 'NSA' inside a layer called 'Receiver_NSA_Label_Join'.
What is the code that I use to do this? Everything I have tried hasn't worked.
Assuming ArcGIS desktop and Python 2.x:
import arcpyfc = 'Your_Feature_Class'fields = ['Fields','You','Want']with arcpy.da.SearchCursor(fc,fields) as cursor: for row in cursor: print row
If using ArcGIS Pro with python 3.x,change
print row# toprint(row)
Thank you! Say I wanted to pull a certain value out of the field using the 'where clause'. How is that done?
If you are trying to use python to display labels on a map that get data from a related table in a one-to-many or many-to-many relationship then take a look at my Creating Labels with Related Table Data Blog.
Retrieving data ...