<?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 Equivalent to Find Tool in ArcPy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1098943#M62422</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there an equivalent to the "Find tool" in ArcMap using arcpy? The find tool is way faster when searching over multiple layers than any code I can come up with... Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 15:04:18 GMT</pubDate>
    <dc:creator>AxelThomas</dc:creator>
    <dc:date>2021-09-16T15:04:18Z</dc:date>
    <item>
      <title>Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1098943#M62422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there an equivalent to the "Find tool" in ArcMap using arcpy? The find tool is way faster when searching over multiple layers than any code I can come up with... Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 15:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1098943#M62422</guid>
      <dc:creator>AxelThomas</dc:creator>
      <dc:date>2021-09-16T15:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1098971#M62423</link>
      <description>&lt;P&gt;If you don't know the exact name or position, I can't think of another way than simply looping over everything that's there and checking for likeness. There may be some inefficiency in your code that could be improved. Feel free to post a snippet of what you're doing.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1098971#M62423</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-16T16:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099106#M62434</link>
      <description>&lt;P&gt;There is no equivalent in arcpy.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 20:35:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099106#M62434</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-09-16T20:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099299#M62440</link>
      <description>&lt;P&gt;I thought so [sigh...]&lt;/P&gt;&lt;P&gt;I am using a two-step approach:&lt;BR /&gt;first selecting feature classes based on name and then looping through the list with a search cursor:&lt;/P&gt;&lt;P&gt;fcList = arcpy.ListFeatureClasses(sSearchStr,"POLYGON")&lt;/P&gt;&lt;P&gt;for fcls in fcList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt = len([r[0] for r in arcpy.da.SearchCursor(fcls, fieldname, where_clause = query)])&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cnt &amp;gt; 0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [....]&lt;/P&gt;&lt;P&gt;Would be great if&amp;nbsp; you have an idea how to speed up this process!&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;</description>
      <pubDate>Fri, 17 Sep 2021 08:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099299#M62440</guid>
      <dc:creator>AxelThomas</dc:creator>
      <dc:date>2021-09-17T08:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099390#M62449</link>
      <description>&lt;P&gt;Are you sure the slowness is coming from ListFeatureClasses()? If so, maybe try &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/walk.htm" target="_self"&gt;arcpy.da.Walk()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If not, it might be the counting of records that's slow.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;posted &lt;A href="https://community.esri.com/t5/gis-blog/the-iterable-cursor-python-built-ins-itertools/ba-p/896458" target="_self"&gt;a blog article&lt;/A&gt; a while back concerning the performance of counting records. Unfortunately, the formatting was lost in transition to the new Geonet forum but he summarizes in the comments that:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;If you can reach back to the layer, feature layer, feature class, table view, or table; then the Get Count tool is by far the quickest method.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;However, it does look like you're applying a where_clause so you'd probably have to make a selection first for get count, which would likely negate the performance gain. Maybe try&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/arcsdesqlexecute.htm" target="_self"&gt;ArcSDESQLExecute()&lt;/A&gt; with a&amp;nbsp; where clause and count?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:21:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099390#M62449</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-17T15:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099613#M62483</link>
      <description>&lt;P&gt;Ensure the field you are querying over has an attribute index built for it.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 12:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099613#M62483</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-09-18T12:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Find Tool in ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099794#M62494</link>
      <description>&lt;P&gt;Thanks to all of you, there are a number of interesting points to check now. Thankfully first I will be off to the mountains for a week or so and will tackle that problem when I'm back&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 06:57:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/equivalent-to-find-tool-in-arcpy/m-p/1099794#M62494</guid>
      <dc:creator>AxelThomas</dc:creator>
      <dc:date>2021-09-20T06:57:55Z</dc:date>
    </item>
  </channel>
</rss>

