<?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: Python arcpy.da.InsertCursor  how to create a newRow() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118582#M9361</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It has been happening a lot today... Xander and I found one this morning as well, links to the help files are flakey at best &lt;A href="https://community.esri.com/migrated-users/2034"&gt;Timothy Hales&lt;/A&gt;​ is this due to the impending upgrades?&amp;nbsp; Spotty at best, but links sometimes work and sometimes don't if copied from a help topic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Mar 2016 16:50:44 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-03-04T16:50:44Z</dc:date>
    <item>
      <title>Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118577#M9356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am converting a arcpy.InsertCursor&amp;nbsp; in arcpy.da.InsertCursor &lt;/P&gt;&lt;P&gt;How does this line works in arcpy.da.InsertCursor &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; row = rows.newRow()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14571058153002436 jive_macro_code jive_text_macro" data-renderedposition="216_8_872_16" jivemacro_uid="_14571058153002436"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;# Create insert cursor for table&lt;/P&gt;&lt;P&gt;rows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create 25 new rows. Set the initial row ID and distance values&lt;/P&gt;&lt;P&gt;for x in range(1, 26):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.newRow()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("rowid", x)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("distance", 100)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.insertRow(row)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:40:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118577#M9356</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-03-04T15:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118578#M9357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't exist any more&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/insertcursor-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/insertcursor-class.htm"&gt;InsertCursor—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118578#M9357</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-04T15:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118579#M9358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So how do I declare the row object now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 16:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118579#M9358</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-03-04T16:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118580#M9359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;arcpy.InsertCursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Create insert cursor for table
rows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut")

# Create 25 new rows. Set the initial row ID and distance values
for x in range(1, 26):
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.newRow()
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("rowid", x)
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("distance", 100)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.insertRow(row)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.da.InsertCursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="n"&gt;fields&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'rowid'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'distance'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;cursor&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;da&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;InsertCursor&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'c:/base/data.gdb/roads_lut'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;fields&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;for x in range(0, 25):&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.insertRow((x, 100))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;Not tested, just going off of the help doc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/insertcursor-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/insertcursor-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;InsertCursor—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;Edit: that link doesn't work if clicked, strange.&amp;nbsp; Just copy/paste url into a new browser address box.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:57:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118580#M9359</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T06:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118581#M9360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Broken link I think, Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 16:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118581#M9360</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-03-04T16:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118582#M9361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It has been happening a lot today... Xander and I found one this morning as well, links to the help files are flakey at best &lt;A href="https://community.esri.com/migrated-users/2034"&gt;Timothy Hales&lt;/A&gt;​ is this due to the impending upgrades?&amp;nbsp; Spotty at best, but links sometimes work and sometimes don't if copied from a help topic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 16:50:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118582#M9361</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-04T16:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118583#M9362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not aware of any issues; however, there are a several issues being fixed with tonight's update. If it continues after the weekend, I will investigate it further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:25:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118583#M9362</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2016-03-04T18:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Python arcpy.da.InsertCursor  how to create a newRow()</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118584#M9363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Jose Sanchez wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do I declare the row object now?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You don't, you pass the values as a list/tuple directly to the insertRow method - it's in the help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Methods&lt;/H2&gt;&lt;PRE class="jive-pre"&gt;insertRow (row)&lt;/PRE&gt;&lt;TABLE border="1" class="jiveBorder" height="234" style="border: 1px solid rgb(198, 198, 198); width: 1335px; height: 179px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Parameter&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Data Type&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;P&gt;row&lt;/P&gt;&lt;P class="expressionhint"&gt;[row,...]&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;&lt;P&gt;A list or tuple of values. The order of values must be in the same order as specified when creating the cursor.&lt;/P&gt;&lt;P&gt;When updating fields, if the incoming values match the type of field, the values will be cast as necessary. For example, a value of &lt;SPAN class="usertext"&gt;1.0&lt;/SPAN&gt; to a string field will be added as &lt;SPAN class="usertext"&gt;"1.0"&lt;/SPAN&gt;, and a value of &lt;SPAN class="usertext"&gt;"25"&lt;/SPAN&gt; added to a float field will be added as &lt;SPAN class="usertext"&gt;25.0&lt;/SPAN&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;tuple&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Mar 2016 21:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-da-insertcursor-how-to-create-a/m-p/118584#M9363</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-03-06T21:29:23Z</dc:date>
    </item>
  </channel>
</rss>

