Cursors
A cursor is used to access data. It is an object created using the Data Access module and can be used to iterate over the rows in a table or insert data into the table. Cursors created in the Data Access module have access to a feature class’s geometry and can read, write, and update geometries. There are three different cursors in the data access module: search, insert, and update. In this section, you will see examples of each and how they can be applied to automate your workflows.
Search cursor
arcpy.da.SearchCursor
will search through your feature class, shapefile, or table line by line and return the data to you. It can return the shape and attribute data, but the data is returned as a tuple so it is immutable. The search cursor has the following two required parameters:
in_table
: The feature class, layer, table, or table view to be searched.field_names
: A list or tuple of the field names to be returned. When using a single field, you...