<?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 Two searchcursors and updatecursor in feature table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/two-searchcursors-and-updatecursor-in-feature/m-p/411219#M32417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have started looking at Python in Arcgis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My aim is to build water hydraulic model from digital cadastre using model builder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Water cadastre is broken into many small pieces. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Each sector (pipe) has attributes about the type of distribution, material, profil, age, etc., but not all. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some pipes are without any attibuttes. Their reocords have no data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have pipes and numerated nodes for these pipes. Each pipe has in his table&amp;nbsp; FROM NODE and TO NODE number. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to write code in Python which would fill no data cells (NN,0 ) in table: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Each pipe without attributes would acquire attributes from previous pipe the same type with attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i will have to repeat that process many times.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Table structure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22136[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;select pipes ID = PK and OZN_KAT = NN&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;find FROM NODE for that pipe&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;find TO NODE = FROM NODE for previous pipe&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;copy [OZN_KAT], [MATERIAL], [PROFIL], [LETO_VGR] from previous pipe to desired pipe.&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;Can you give me a clue how to do that? Or something more. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to use code first in Python and then also in calculate value toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thnx&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2013 12:37:10 GMT</pubDate>
    <dc:creator>FranciNovak</dc:creator>
    <dc:date>2013-02-25T12:37:10Z</dc:date>
    <item>
      <title>Two searchcursors and updatecursor in feature table</title>
      <link>https://community.esri.com/t5/python-questions/two-searchcursors-and-updatecursor-in-feature/m-p/411219#M32417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have started looking at Python in Arcgis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My aim is to build water hydraulic model from digital cadastre using model builder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Water cadastre is broken into many small pieces. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Each sector (pipe) has attributes about the type of distribution, material, profil, age, etc., but not all. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some pipes are without any attibuttes. Their reocords have no data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have pipes and numerated nodes for these pipes. Each pipe has in his table&amp;nbsp; FROM NODE and TO NODE number. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to write code in Python which would fill no data cells (NN,0 ) in table: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Each pipe without attributes would acquire attributes from previous pipe the same type with attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i will have to repeat that process many times.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Table structure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22136[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;select pipes ID = PK and OZN_KAT = NN&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;find FROM NODE for that pipe&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;find TO NODE = FROM NODE for previous pipe&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;copy [OZN_KAT], [MATERIAL], [PROFIL], [LETO_VGR] from previous pipe to desired pipe.&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;Can you give me a clue how to do that? Or something more. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to use code first in Python and then also in calculate value toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thnx&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 12:37:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/two-searchcursors-and-updatecursor-in-feature/m-p/411219#M32417</guid>
      <dc:creator>FranciNovak</dc:creator>
      <dc:date>2013-02-25T12:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Two searchcursors and updatecursor in feature table</title>
      <link>https://community.esri.com/t5/python-questions/two-searchcursors-and-updatecursor-in-feature/m-p/411220#M32418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How many features are you going to be going through? Is this a process you will be doing often or rarely? Depending on this you could read out the entire dataset to a dictionary using a search cursor then use an update cursor on the rows you want to transfer the values to. This would probably be the fastest method if a bit memory intensive depending on the size of your dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that isn't the route you want to take you could use nested cursors as you described in your title. This may be one of the few cases it might make sense to use nested cursors if this is a process you rarely do and/or you are dealing with a very large dataset with many row pairs you need to read and write.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 13:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/two-searchcursors-and-updatecursor-in-feature/m-p/411220#M32418</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-02-25T13:58:00Z</dc:date>
    </item>
  </channel>
</rss>

