BrokenLegMike

Alternative to Using 'getValue' with Data Access Module

Discussion created by BrokenLegMike on Mar 27, 2014
Latest reply on Mar 28, 2014 by Wayne_Whitley
With the arcpy.da module, we cannot use the getValue method on the row object as we can in arcpy.SearchCursor:

for row in arcpy.SearchCursor(fc):
             row.getValue("SITE_ID")


We can, however, index over the columns for the row object:

with arcpy.da.SearchCursor(fc, "*") as cursor:
 for row in cursor:
  print row[1]


I want to use the data access module because it cuts my processing time by almost a half. Indexing over columns on the row object doesn't really work for me because I am using this on an excel spreasheet where users may move columns around. I prefer to pull the heading name as I can with getValue. Is there a way to do this in the da module?

Thanks,
Mike

Outcomes