AnsweredAssumed Answered

How to use field name instead or numeric index to find value in row,cursor

Question asked by jsn on Oct 5, 2017
Latest reply on Oct 8, 2017 by bixb0012

Hello everyone,

 

I am looking for a way to compare fields from two rows from two SearchCursor but I would like to use a filed name instead of a numeric index

 

instead of  if rowYesterday[1] != rowToday[1] ]:   

 

is there a way to check  for

 

if rowYesterday[ 'CODE'] != rowToday['CODE'] ]:

 

 

This is a simplified version of my source code:

 

with arcpy.da.SearchCursor(WASDWSCORDINANCELETTER_Psde3, fieldnames, whereClause) as srcYesterday:
      for rowYesterday in srcYesterday:

                     if rowYesterday[1] != rowToday[1] ]:

                        // Do somenting

Outcomes