<?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: Newly Added Field: Not being recognized in Python Function in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555602#M43397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was busy posting my answer to my own question, when your reply came through. By specifying the starting number of the index I was able to solve it. Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2016 19:22:02 GMT</pubDate>
    <dc:creator>PeterWilson</dc:creator>
    <dc:date>2016-07-13T19:22:02Z</dc:date>
    <item>
      <title>Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555595#M43390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added a new field "CatchAreaKm2" (Double) to a File Geodatabase Table. I then create a list of fields of the table that will be used in an UpdateCursor. The problem that I have is that the newly added field is listed within the list of fields yet when I iterate through a sliced version of the fields (landuse) it doesn't recognize the newly added "CatchAreaKm2" field and I can't understand for the life of me why not. In order the get a list of the Landuse fields the index slice should be row[1:-1] yet if I use the following it skips the last landuse field ignoring the newly added field. in order to get the following to work I need to using the index slice row[1:]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help solving why the newly field is not being recognized will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;[u'HydroID', u'Commercial_Forestry', u'Cultivated', u'Indigenous', u'Mines', u'Natural_Vegetation_Forest', u'Urban', u'Waterbodies', u'Wetlands', u'CatchAreaKm2']&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Python: landuse_fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# calculate percentage of landuse per watershed
def landuse_percentage(watershed, output_pivot):
&amp;nbsp;&amp;nbsp;&amp;nbsp; watershed_fields = ["HydroID", "Shape_Area"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; valuedict = {r[0]: (r[1:]) for r in arcpy.da.SearchCursor(watershed, watershed_fields)}&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(output_pivot, "CatchAreaKm2", "DOUBLE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; landuse_fields = [f.name for f in arcpy.ListFields(output_pivot)[1:]]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(landuse_fields)
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(output_pivot, landuse_fields) as upcur:&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in upcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyvalue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keyvalue in valuedict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Watershed {0}".format(keyvalue))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add catchment area km² to newly added field
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[-1] = valuedict[keyvalue][0]/1000000
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i, landuse in enumerate(row[1:]): # index slice not picking up newly added field
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;I&gt; = (row&lt;I&gt;*(28*28))/(valuedict[keyvalue][0])*100&lt;/I&gt;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; upcur.updateRow(row)

landuse_percentage(watershed, output_pivot)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python: Code (Currently working)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# calculate percentage of landuse per watershed
def landuse_percentage(watershed, output_pivot):
&amp;nbsp;&amp;nbsp;&amp;nbsp; watershed_fields = ["HydroID", "Shape_Area"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; valuedict = {r[0]: (r[1:]) for r in arcpy.da.SearchCursor(watershed, watershed_fields)}&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(output_pivot, "CatchAreaKm2", "DOUBLE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; landuse_fields = [f.name for f in arcpy.ListFields(output_pivot)[1:]]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(landuse_fields)
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(output_pivot, landuse_fields) as upcur:&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in upcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyvalue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keyvalue in valuedict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Watershed {0}".format(keyvalue))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add catchment area km² to newly added field
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[-1] = valuedict[keyvalue][0]/1000000
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i, landuse in enumerate(row[1:-1]): # index slice should be
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;I&gt; = (row&lt;I&gt;*(28*28))/(valuedict[keyvalue][0])*100&lt;/I&gt;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; upcur.updateRow(row)

landuse_percentage(watershed, output_pivot)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python: Code (Not working)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555595#M43390</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2021-12-12T00:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555596#M43391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Peter,&lt;/P&gt;&lt;P&gt;What do you mean "doesn't recognize the newly added".&lt;/P&gt;&lt;P&gt;Has the AddField worked or not?&lt;/P&gt;&lt;P&gt;What error do you get if you access the field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 15:27:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555596#M43391</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-07-13T15:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555597#M43392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neil&lt;/P&gt;&lt;P&gt;The field is added and identified within the list, yet when I step into line 15 I should have to adjust the index slice row[1:] to row[1:-1] to exclude the added field from fields being updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 15:41:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555597#M43392</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2016-07-13T15:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555598#M43393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;​ \ Luke &lt;A href="https://community.esri.com/migrated-users/8829"&gt;Luke Pinner&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wonder if either of you have any idea why my enumerate function isn't working as expected. The index slice should be row[1:-1] yet it doesn't work, only row[1:] works, which shouldn't as it would include the newly added "CatchAreaKm2" field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 18:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555598#M43393</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2016-07-13T18:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555599#M43394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slicing&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; flds = [u'HydroID', u'Commercial_Forestry',...snip.., u'Urban', u'Waterbodies', u'Wetlands', u'CatchAreaKm2']
&amp;gt;&amp;gt;&amp;gt; flds[1:]
['Commercial_Forestry', ... snip..., 'Urban', 'Waterbodies', 'Wetlands', 'CatchAreaKm2']
&amp;gt;&amp;gt;&amp;gt; flds[1:-1]
['Commercial_Forestry', 'Cultivated',&amp;nbsp; ...snip... 'Urban', 'Waterbodies', 'Wetlands']
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; flds[:-1]
['HydroID', 'Commercial_Forestry', ... snip..., 'Urban', 'Waterbodies', 'Wetlands']&lt;/PRE&gt;&lt;P&gt;lst, 1: slice from index 1 to end&lt;/P&gt;&lt;P&gt;2nd slice from 1 to everything except the last&lt;/P&gt;&lt;P&gt;3rd&amp;nbsp; slice from the start (index 0) except the last.&lt;/P&gt;&lt;P&gt;I am not quite sure why you need an enumerator... I will have to think... I tend not to use iterators, generators etc, but either to use the built-in array operations or variants of list comprehensions (ie set, dictionary comps) Do be aware that numpy has builtin iterators and generators which work best with arrays more so that their pure python equivalents.&amp;nbsp;&amp;nbsp; Something else to write about now that I have thrown it out &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555599#M43394</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555600#M43395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your enumerate 'i' still starts at 0, even though the list you're enumerating starts at 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; my_fields = [u'HydroID', u'Commercial_Forestry', u'Cultivated', u'Indigenous', u'Mines', u'Natural_Vegetation_Forest', u'Urban', u'Waterbodies', u'Wetlands', u'CatchAreaKm2']
... for i, landuse in enumerate(my_fields[1:]):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print (i,my_fields&lt;I&gt;)&lt;/I&gt;
...&amp;nbsp;&amp;nbsp; 
(0, u'HydroID')
(1, u'Commercial_Forestry')
(2, u'Cultivated')
(3, u'Indigenous')
(4, u'Mines')
(5, u'Natural_Vegetation_Forest')
(6, u'Urban')
(7, u'Waterbodies')
(8, u'Wetlands')

&amp;gt;&amp;gt;&amp;gt; my_fields = [u'HydroID', u'Commercial_Forestry', u'Cultivated', u'Indigenous', u'Mines', u'Natural_Vegetation_Forest', u'Urban', u'Waterbodies', u'Wetlands', u'CatchAreaKm2']
... for i, landuse in enumerate(my_fields[1:-1]):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print (i,my_fields&lt;I&gt;)&lt;/I&gt;
...&amp;nbsp;&amp;nbsp; 
(0, u'HydroID')
(1, u'Commercial_Forestry')
(2, u'Cultivated')
(3, u'Indigenous')
(4, u'Mines')
(5, u'Natural_Vegetation_Forest')
(6, u'Urban')
(7, u'Waterbodies')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555600#M43395</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T00:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555601#M43396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I solved it, I was correct that the index slice should be row[1:-1] what I had missed that the index starts at 0 and can be managed with an optional argument within &lt;A href="http://book.pythontips.com/en/latest/enumerate.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Python Enumerate Function&lt;/A&gt;​.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# calculate percentage of landuse per watershed
def landuse_percentage(watershed, output_pivot):
&amp;nbsp;&amp;nbsp;&amp;nbsp; watershed_fields = ["HydroID", "Shape_Area"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; valuedict = {r[0]: (r[1:]) for r in arcpy.da.SearchCursor(watershed, watershed_fields)}&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(output_pivot, "CatchAreaKm2", "DOUBLE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; landuse_fields = [f.name for f in arcpy.ListFields(output_pivot)[1:]]
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(output_pivot, landuse_fields) as upcur:&amp;nbsp; # @UndefinedVariable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in upcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyvalue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keyvalue in valuedict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Watershed {0}".format(keyvalue))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[-1] = valuedict[keyvalue][0]/1000000
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i, landuse in enumerate(row[1:-1], 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;I&gt; = (landuse*(28*28))/(valuedict[keyvalue][0])*100&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Index: {0}, Landuse: {1}, CatchAreaKm2: {2}, Percentage: {3}".format(i, landuse, row[-1], row&lt;I&gt;))&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; upcur.updateRow(row)


landuse_percentage(watershed, output_pivot)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the help, from everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555601#M43396</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2021-12-12T00:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555602#M43397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was busy posting my answer to my own question, when your reply came through. By specifying the starting number of the index I was able to solve it. Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 19:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555602#M43397</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2016-07-13T19:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555603#M43398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me. The reason for using the enumerator was to be able to update a specific list of fields within the UpdateCursor using the same formula without having to specify each index position (i.e. row[1], row[2]) etc. I solved the following by using the optional argument to specify the starting index number. The original post is under the following discusssion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/179689"&gt;Data Access Module: Update Cursor (Not Updating Records)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 19:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555603#M43398</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2016-07-13T19:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555604#M43399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Peter, that was my bad, I missed the fact you were slicing your row list to start from the 2nd element. I've updated my answer in your other post - &lt;A _jive_internal="true" href="https://community.esri.com/message/620711#comment-620711" title="https://community.esri.com/message/620711#comment-620711"&gt;https://community.esri.com/message/620711#comment-620711&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 20:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555604#M43399</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-07-13T20:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Newly Added Field: Not being recognized in Python Function</title>
      <link>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555605#M43400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luke&lt;/P&gt;&lt;P&gt;Not a problem, thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 07:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newly-added-field-not-being-recognized-in-python/m-p/555605#M43400</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2016-07-14T07:35:46Z</dc:date>
    </item>
  </channel>
</rss>

