<?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 Loop Attribute Field Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249876#M64456</link>
    <description>&lt;P&gt;Johannes Thank you so much. This worked like a charm!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 14:24:27 GMT</pubDate>
    <dc:creator>TimothyODoherty</dc:creator>
    <dc:date>2023-01-20T14:24:27Z</dc:date>
    <item>
      <title>For Loop Attribute Field Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249857#M64451</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an attribute table with over 760,00 polylines (River Segments). I want to group these river segments into 380 individual features (Rivers). I need a python script / ModelBuilder method that can for loop over a attribute field, that every time the value reverts back to 0 it creates a feature or inputs an incremented value into another field (RiverID). This can be seen in the attached photos in the field "segmentInd'; as this field is the number of measurements from the river source in an ascending order downstream.&lt;/P&gt;&lt;P&gt;There are no other fields that are unique to allow me to select by them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to python and do not know how to for loop over an attribute table.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 12:54:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249857#M64451</guid>
      <dc:creator>TimothyODoherty</dc:creator>
      <dc:date>2023-01-20T12:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop Attribute Field Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249859#M64452</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Copy/paste this script into the Python Window, change the name of the layer, execute&lt;/P&gt;&lt;LI-CODE lang="python"&gt;river_id = 0
with arcpy.da.UpdateCursor("NameOfTheLayer", ["segmentInd", "RiverID"]) as cursor:
    for row in cursor:
        if row[0] == 0:
            river_id += 1
        cursor.updateRow([row[0], river_id])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Jan 2023 13:03:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249859#M64452</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-20T13:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop Attribute Field Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249876#M64456</link>
      <description>&lt;P&gt;Johannes Thank you so much. This worked like a charm!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 14:24:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/for-loop-attribute-field-python/m-p/1249876#M64456</guid>
      <dc:creator>TimothyODoherty</dc:creator>
      <dc:date>2023-01-20T14:24:27Z</dc:date>
    </item>
  </channel>
</rss>

