with arcpy.da.SearchCursor(fc, ['STATE_NAME', 'POP2000']) as cursor: for row in cursor: # Access and print the row values by index position. # state name: row[0] # population: row[1] # print('{0} has a population of {1}'.format(row[0], row[1]))
# your count value as a var named 'count' count = arcpy.GetCount.... etc. with arcpy.da.SearchCursor(fc, ['fieldA']) as cursor: row = cursor.next() for i in range(count): if i <= count - 2: print('row {0} has a value of {1}'.format(str(i + 1), row[0])) row = cursor.next()
i = 0 lastvalue = [] with arcpy.da.SearchCursor(fc, ["fieldA"]) as cursor: for row in cursor: lastvalue.append(row[0]) # keep track of all your values so you have a lookup table. if i == 9: # this is the last row in the table, i.e. row 10 if row[0] == lastvalue[i-1]: # compare the last row in the table to row 9. print('current row equals the previous row') i += 1
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.