<?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: for look for ListFields in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228364#M744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: hua17&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try using "field.type", like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

arcpy.env.workspace = r"C:\StatsCanada.gdb\Saskatchewan"
featureclass = ("PopulatedCentres")

allFields=arcpy.ListFields(featureclass)

for field in allFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.type in ["Double","Integer","SmallInteger"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SpatialAutocorrelation_stats(featureclass, field.name,"GENERATE_REPORT","INVERSE_DISTANCE","EUCLIDEAN_DISTANCE","NONE","#","#")
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want a bit more information on all the field types, you can find it &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help../index.html#//000v0000001p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:06:57 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-11T11:06:57Z</dc:date>
    <item>
      <title>for look for ListFields</title>
      <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228361#M741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am looking to create a for look to loop through all my ListFields and the Field name is one of the parameters in a Spatial Statistic tool.&amp;nbsp; Can anyone help please....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having trouble understanind what variable to declare.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 15:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228361#M741</guid>
      <dc:creator>Ryan_Galbraith</dc:creator>
      <dc:date>2013-12-19T15:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: for look for ListFields</title>
      <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228362#M742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: hua17&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I might be misunderstanding, but if you want to loop through all field names in a feature class, you can use &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help../index.html#//000v0000001p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;arcpy.ListFields&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this might work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

allFields=arcpy.ListFields("C://Path//To//Data.shp")

for field in allFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Field Name: "+ field.name
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Do stuff here
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if that helps at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;~Josh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228362#M742</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: for look for ListFields</title>
      <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228363#M743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you, thank you, thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = r"C:\StatsCanada.gdb\Saskatchewan"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureclass = ("PopulatedCentres")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;allFields=arcpy.ListFields(featureclass)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for field in allFields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SpatialAutocorrelation_stats(featureclass, field.name,"GENERATE_REPORT","INVERSE_DISTANCE","EUCLIDEAN_DISTANCE","NONE","#","#")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I got this, but it doesn't like the fields at the beginning of the fields.&amp;nbsp; Any idea how to just get the fields with numbers in them?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 18:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228363#M743</guid>
      <dc:creator>Ryan_Galbraith</dc:creator>
      <dc:date>2013-12-19T18:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: for look for ListFields</title>
      <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228364#M744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: hua17&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try using "field.type", like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

arcpy.env.workspace = r"C:\StatsCanada.gdb\Saskatchewan"
featureclass = ("PopulatedCentres")

allFields=arcpy.ListFields(featureclass)

for field in allFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.type in ["Double","Integer","SmallInteger"]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SpatialAutocorrelation_stats(featureclass, field.name,"GENERATE_REPORT","INVERSE_DISTANCE","EUCLIDEAN_DISTANCE","NONE","#","#")
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want a bit more information on all the field types, you can find it &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help../index.html#//000v0000001p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228364#M744</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T11:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: for look for ListFields</title>
      <link>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228365#M745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh man, that work - perfectly!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 15:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/for-look-for-listfields/m-p/228365#M745</guid>
      <dc:creator>Ryan_Galbraith</dc:creator>
      <dc:date>2014-01-29T15:01:17Z</dc:date>
    </item>
  </channel>
</rss>

