<?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: Getting a count of the rows and having the output in a table using model builder and python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269462#M20767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I was able to run the model using Summary Statistics and now have a different question. I will put the question in a separate post and will look forward to a reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tilo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Sep 2019 04:58:12 GMT</pubDate>
    <dc:creator>TilottamaGhosh</dc:creator>
    <dc:date>2019-09-20T04:58:12Z</dc:date>
    <item>
      <title>Getting a count of the rows and having the output in a table using model builder and python</title>
      <link>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269460#M20765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running a model, and in the end I need to get a count of the rows, 'collect values' (model builder tool) and 'calculate values'&amp;nbsp;&lt;SPAN&gt;(model builder tool) and get the output in a table. I am unable to do this. I am using the python code from this post&amp;nbsp;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/79424/using-modebuilder-to-populate-a-table-with-the-feature-count-of-multiple-feature" title="https://gis.stackexchange.com/questions/79424/using-modebuilder-to-populate-a-table-with-the-feature-count-of-multiple-feature"&gt;arcgis desktop - Using ModeBuilder to populate a table with the feature count of multiple feature classes - Geographic I…&lt;/A&gt;&amp;nbsp;, but running into an error with the python code block -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; margin: 0px 0px 1em; padding: 12px 8px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt; def sum_counts(counts):         if counts.find(';') == -1:             if counts &amp;lt;&amp;gt; '#': return int(counts)             else: return 0         else:              return sum(map(int, counts.split(';')))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What am I doing wrong? How will I achieve getting a count of the rows and putting the output in a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tilottama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 21:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269460#M20765</guid>
      <dc:creator>TilottamaGhosh</dc:creator>
      <dc:date>2019-09-19T21:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a count of the rows and having the output in a table using model builder and python</title>
      <link>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269461#M20766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;code was formatted improperly.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting" target="_blank"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What was the actual error message?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;sum_counts&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;counts&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; counts&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;find&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="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; counts &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; '&lt;SPAN class="comment token"&gt;#':&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;counts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;int&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; counts&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&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="punctuation token"&gt;)&lt;/SPAN&gt;&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269461#M20766</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T13:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a count of the rows and having the output in a table using model builder and python</title>
      <link>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269462#M20767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I was able to run the model using Summary Statistics and now have a different question. I will put the question in a separate post and will look forward to a reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tilo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 04:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-a-count-of-the-rows-and-having-the-output/m-p/269462#M20767</guid>
      <dc:creator>TilottamaGhosh</dc:creator>
      <dc:date>2019-09-20T04:58:12Z</dc:date>
    </item>
  </channel>
</rss>

