address_sum <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'AddressPtsFormatted'</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"PLOC_"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> r <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
number <SPAN class="operator token">=</SPAN> r<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
address_sum <SPAN class="operator token">+=</SPAN> number<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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)