<?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: Convert Count from GetCount to Int without using Pandas in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392195#M79928</link>
    <description>&lt;P&gt;Always proving there's more than one way to skin a cat[fish]:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;count = int(arcpy.management.GetCount('feature')[0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you ask for the first index on that Result object, you get the actual result/number, itself—albeit as a string (I think).&amp;nbsp; Don't quote me on the exact datatype, but I know this is the syntax I typically use, and I haven't seen any errors from it, yet.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2024 22:19:37 GMT</pubDate>
    <dc:creator>MErikReedAugusta</dc:creator>
    <dc:date>2024-03-06T22:19:37Z</dc:date>
    <item>
      <title>Convert Count from GetCount to Int without using Pandas</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392042#M79912</link>
      <description>&lt;P&gt;Based on the code below how can I store the resultant value from GetCount in a numeric datatype? When I try the `int` function I&amp;nbsp; get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;TypeError: int() argument must be a string, a bytes-like object or a number, not 'Result'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
arcpy.env.workspace = "C:/data/data.gdb"
Count = arcpy.management.GetCount("roads")
Count = int(Count)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 18:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392042#M79912</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-03-06T18:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Count from GetCount to Int without using Pandas</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392052#M79914</link>
      <description>&lt;P&gt;Never mind, the following fixes it by adding&amp;nbsp;getOutput(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
arcpy.env.workspace = "C:/data/data.gdb"
Count = int(arcpy.management.GetCount("roads").getOutput(0)) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This post helped:&lt;/P&gt;&lt;H1&gt;&lt;FONT size="4"&gt;&lt;A href="https://community.esri.com/t5/python-questions/how-to-determine-number-of-records-using-arcpy-da/td-p/316397" target="_self"&gt;How to determine number of records using arcpy.da.SearchCursor&lt;/A&gt;&lt;/FONT&gt;&lt;/H1&gt;</description>
      <pubDate>Wed, 06 Mar 2024 18:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392052#M79914</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-03-06T18:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Count from GetCount to Int without using Pandas</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392195#M79928</link>
      <description>&lt;P&gt;Always proving there's more than one way to skin a cat[fish]:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;count = int(arcpy.management.GetCount('feature')[0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you ask for the first index on that Result object, you get the actual result/number, itself—albeit as a string (I think).&amp;nbsp; Don't quote me on the exact datatype, but I know this is the syntax I typically use, and I haven't seen any errors from it, yet.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 22:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-count-from-getcount-to-int-without-using/m-p/1392195#M79928</guid>
      <dc:creator>MErikReedAugusta</dc:creator>
      <dc:date>2024-03-06T22:19:37Z</dc:date>
    </item>
  </channel>
</rss>

