<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Strange errors in Pro's Python window with search cursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572399#M44874</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you posted a partial Traceback, can you share the whole thing?&amp;nbsp; Does Line 1 in your code snippet line up with Line 1 in the error message?&amp;nbsp; I am guessing not because setting a variable to zero would not generate a TypeError.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2020 22:40:21 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2020-07-17T22:40:21Z</dc:date>
    <item>
      <title>Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572398#M44873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;address_sum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'AddressPtsFormatted'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PLOC_"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   number &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
   address_sum &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; number‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;returns the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt; TypeError: string indices must be integers‍‍‍‍‍‍‍&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code runs in jupytr notebook&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(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)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:38:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572398#M44873</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2021-12-12T00:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572399#M44874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you posted a partial Traceback, can you share the whole thing?&amp;nbsp; Does Line 1 in your code snippet line up with Line 1 in the error message?&amp;nbsp; I am guessing not because setting a variable to zero would not generate a TypeError.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:40:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572399#M44874</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-07-17T22:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572400#M44875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also, lines 4 and 5 are not indented properly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572400#M44875</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-17T22:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572401#M44876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to make it look better from what was pasted in from Pro. The code runs fine in a jupytr notebook.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572401#M44876</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2020-07-17T22:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572402#M44877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was what was in the Python window in Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally when I used cursors, row[0] is not an issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it works in this:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;PLOCU_set&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PLOCU_"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572402#M44877</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2020-07-17T22:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572403#M44878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"AddressPtsFormatted"&lt;/SPAN&gt;
address_sum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'AddressPtsFormatted'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PLOC_"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
       number &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
       address_sum &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; number
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  File &lt;SPAN class="string token"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; string indices must be integers‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I ran. I cant edit the first post. And I just learned that it helps to set the language before you past code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:38:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572403#M44878</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2021-12-12T00:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572404#M44879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At a minimum, you are missing a comma after the first argument in your SearchCursor.&amp;nbsp; Try fixing that first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 23:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572404#M44879</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-07-17T23:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572405#M44880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Side by Side comparison of jupytr notebook and Pro" s="" python="" window="" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 23:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572405#M44880</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2020-07-17T23:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572406#M44881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ohhhhhhhhhhhh thats it i bet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 23:04:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572406#M44881</guid>
      <dc:creator>DanDeegan</dc:creator>
      <dc:date>2020-07-17T23:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572407#M44882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might check the value type which script returns, it looks like the type is string rather than integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2020 13:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572407#M44882</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-07-18T13:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572408#M44883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I cant edit the first post.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Look for the edit button at upper right (you can't edit in a dropdown but you can edit by clicking up there).&lt;/P&gt;&lt;P&gt;Not that it matters that much: new Geonet platform soon!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2020 16:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/572408#M44883</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2020-07-18T16:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Strange errors in Pro's Python window with search cursor</title>
      <link>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/1013508#M59400</link>
      <description>&lt;P&gt;TypeError: means that you are trying to perform an operation on a value whose type is not compatible with that operation. An Iterable is a collection of elements that can be accessed sequentially . In Python, iterable objects are indexed using numbers . When you try to access an iterable object using a string or a float as the index, an error will be returned as TypeError: &lt;A href="http://net-informations.com/python/err/indices.htm" target="_self"&gt;string indices must be integers&lt;/A&gt;. This means that when you're accessing an iterable object like a string or float value, you must do it using an integer value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 06:13:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-errors-in-pro-s-python-window-with-search/m-p/1013508#M59400</guid>
      <dc:creator>jefryarch</dc:creator>
      <dc:date>2021-01-04T06:13:47Z</dc:date>
    </item>
  </channel>
</rss>

