<?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: sequence size must match size of the row in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702193#M54413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The sequence size error is saying you are either trying to insert fewer or more items into a record than what the cursor is set up for.&amp;nbsp; Since you are using &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;"*"&lt;/SPAN&gt; for the fields, which by the way is a poor practice, I can't say for sure what is going wrong with the fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Oct 2020 04:14:03 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2020-10-16T04:14:03Z</dc:date>
    <item>
      <title>sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702192#M54412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;Hi, I am looking for some help on proper syntax in ArcGIS Pro/ Python 3. I am trying to read data from a feature class and write to another feature class. The attribute fields are different so I am reading from source and assigning it to output. I get this error at insertCursor.insertRow(newRow).&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;Appreciate any input.&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px var(--s-prose-spacing) 0px;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: var(--highlight-comment); border: 0px; font-weight: inherit; font-size: 13px;"&gt;def LoadData(fSource, fTarget):
# setup search cursor&lt;/SPAN&gt;fields = [&lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;'*'&lt;/SPAN&gt;]  fldShape = &lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;"SHAPE@"&lt;/SPAN&gt;&lt;SPAN class="" style="color: var(--highlight-comment); border: 0px; font-weight: inherit; font-size: 13px;"&gt;# target field mapping &lt;/SPAN&gt;fldCountry = &lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;'Country'&lt;/SPAN&gt;fldCommodity = &lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;"Product"&lt;/SPAN&gt;constructionYear = &lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;"CNSTR_YEAR"&lt;/SPAN&gt;&lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;try&lt;/SPAN&gt;:      &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;with&lt;/SPAN&gt; arcpy.da.InsertCursor(fTarget, [&lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;'*'&lt;/SPAN&gt;]) &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;as&lt;/SPAN&gt; insertCursor:         &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;with&lt;/SPAN&gt; arcpy.da.SearchCursor(fSource, &lt;SPAN class="" style="color: var(--highlight-variable); border: 0px; font-weight: inherit; font-size: 13px;"&gt;"*"&lt;/SPAN&gt;) &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;as&lt;/SPAN&gt; cursor:             &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;in&lt;/SPAN&gt; cursor:                 country = row[cursor.fields.index(fldCountry)]                 geometry = row[cursor.fields.index(fldShape)]                 commodity = row[cursor.fields.index(fldCommodity)]                 constructionYear = row[cursor.fields.index(constructionYear)]                                  newRow = [country, geometry, commodity, constructionYear]                  insertCursor.insertRow(newRow)  &lt;SPAN class="" style="color: var(--highlight-keyword); border: 0px; font-weight: inherit; font-size: 13px;"&gt;except&lt;/SPAN&gt; Exception:         print(e.args[&lt;SPAN class="" style="color: var(--highlight-namespace); border: 0px; font-weight: inherit; font-size: 13px;"&gt;0&lt;/SPAN&gt;])&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:32:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702192#M54412</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2021-12-12T05:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702193#M54413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The sequence size error is saying you are either trying to insert fewer or more items into a record than what the cursor is set up for.&amp;nbsp; Since you are using &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;"*"&lt;/SPAN&gt; for the fields, which by the way is a poor practice, I can't say for sure what is going wrong with the fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 04:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702193#M54413</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-16T04:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702194#M54414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would help with reading&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 05:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702194#M54414</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-10-16T05:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702195#M54415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;LoadData&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fTarget&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

  &lt;SPAN class="comment token"&gt;# setup search cursor&lt;/SPAN&gt;
fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

fldShape &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# target field mapping&lt;/SPAN&gt;
fldCountry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Country'&lt;/SPAN&gt;
fldCommodity &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Product"&lt;/SPAN&gt;
constructionYear &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CNSTR_YEAR"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fTarget&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; insertCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  country &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fldCountry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fldShape&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
commodity &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fldCommodity&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
constructionYear &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;constructionYear&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

newRow &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;country&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; commodity&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; constructionYear&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

insertCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; Exception&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;args&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702195#M54415</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2021-12-12T05:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702196#M54416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua, I will try limiting the fields and see it helps.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702196#M54416</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2020-10-16T16:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702197#M54417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks better formatting, Thanks Dan for pointing this out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702197#M54417</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2020-10-16T16:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702198#M54418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/3420" target="_blank"&gt;Joshua Bixby&lt;/A&gt;‌ states, using a wildcard for the&amp;nbsp; fields is a bad idea.&amp;nbsp; In your case, you cannot be sure the order you are assembling the row matches the order the data was selected.&amp;nbsp; Also, for testing you should avoid a try/except block so the error messages will be clear and you can see what exceptions you may need to guard against.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we assume that the field names are identical (as well as field type and length)&amp;nbsp; between the source and target features?&amp;nbsp; If so, you might test the following with copies of your data:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fSource = '' # some source
fTarget = '' # the target

fields = ['SHAPE@', 'Country', 'Product', 'CNSTR_YEAR'] # assuming same name used in both target/source

with with arcpy.da.InsertCursor(fTarget, fields) as insertCursor:
    with arcpy.da.SearchCursor(fSource, fields) as cursor:
        for row in cursor:
            insertCursor.insertRow(row)
‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:32:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702198#M54418</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T05:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702199#M54419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Randy, Your code works great. I have one calculated value that doesn't exist in source data, how do I update that field in target using this construct.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 21:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702199#M54419</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2020-10-16T21:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702200#M54420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need a bit more information on the calculation.&amp;nbsp; But I would add a field to a targetField list.&amp;nbsp; Then do the calculation just before the insert row.&amp;nbsp; The idea would be something like this, but the code is untested and needs modification to do the calculation.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fSource &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# some source&lt;/SPAN&gt;
fTarget &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# the target&lt;/SPAN&gt;

sourceFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Country'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Product'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CNSTR_YEAR'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; 
targetFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Country'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Product'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CNSTR_YEAR'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CalcField'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# add calculated field&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fTarget&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; targetFields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; insertCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sourceFields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            newRow &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; list&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# get sourceField values&lt;/SPAN&gt;
            x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# some calculation&lt;/SPAN&gt;
            newRow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# append calculation to end&lt;/SPAN&gt;
            insertCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# insert newRow to fTarget‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702200#M54420</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T05:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: sequence size must match size of the row</title>
      <link>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702201#M54421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Randy, Joshua for your help on this. this works like a charm, really appreciate your help on this.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2020 15:36:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sequence-size-must-match-size-of-the-row/m-p/702201#M54421</guid>
      <dc:creator>jayshukla</dc:creator>
      <dc:date>2020-10-19T15:36:00Z</dc:date>
    </item>
  </channel>
</rss>

