AnsweredAssumed Answered

Strange errors in Pro's Python window with search cursor

Question asked by ddeegan on Jul 17, 2020
Latest reply on Jul 18, 2020 by curtvprice
address_sum = 0
with arcpy.da.SearchCursor('AddressPtsFormatted' ["PLOC_"]) as cursor:
   for r in cursor:
   number = r[0]
   address_sum += number

returns the error: 

Traceback (most recent call last):File "<string>", line 1, in <module> TypeError: string indices must be integers

 

The code runs in jupytr notebook

 

(no, i wasn't adding up every address in my area because I am loopy on Friday afternoon, why would anyone find the sum of addresses)

Outcomes