<?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: error with UpdateCursor in Jupyter notebook in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038054#M38999</link>
    <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Thanks for the interesting response.&lt;/P&gt;&lt;P&gt;I am indeed using an advanced notebook.&lt;/P&gt;&lt;P&gt;I will take a look at the dataframes, but would also really like to solve the problem with the UpdateCursor.&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 14:13:46 GMT</pubDate>
    <dc:creator>GrantBenn1</dc:creator>
    <dc:date>2021-03-18T14:13:46Z</dc:date>
    <item>
      <title>error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1037985#M38989</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to Jupyter notebooks in AGOL. I am trying to develop a script which updates a field in&amp;nbsp; a hosted feature layer based on what has been entered in other fields. I am getting an error (code 400) pointing to the "for row in cursor:" line. This script works perfectly on my desktop machine. Any ideas as to what might be wrong? Here is what I am seeing in Notebook.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GrantBenn1_0-1616070232033.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8762i6E0EF87DAAD1DF4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GrantBenn1_0-1616070232033.png" alt="GrantBenn1_0-1616070232033.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 12:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1037985#M38989</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-18T12:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1037997#M38992</link>
      <description>&lt;P&gt;For one thing, ArcPy is only available in the &lt;EM&gt;advanced&lt;/EM&gt; notebooks (the ones that cost you credits to run), so I'd make sure your notebook runtime is correct.&lt;/P&gt;&lt;P&gt;If you're working with hosted layers and AGOL, you're much better off using the &lt;A href="https://developers.arcgis.com/python/api-reference/" target="_self"&gt;ArcGIS Python API&lt;/A&gt; and spatially enabled dataframes. Here's a sample of how you might use it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS

# Log in to portal; for AGOL notebooks, you can also use gis = GIS("home")
gis = GIS('portal-url', 'user', 'password')

# Get your hosted layer you want updated
fc = gis.content.get('itemID').layers[0]

# Query out all features to a dataframe
df = fc.query(out_fields=['the', 'fields', 'you', 'need'], return_geometry=False, as_df=True)

# Subset rows for those where 'field_a', etc., is greater than 0, add 1 to 'target_field'
df.loc[df['field_a'] &amp;gt; 0, 'target_field'] = df['target_field'] + 1
df.loc[df['field_b'] &amp;gt; 0, 'target_field'] = df['target_field'] + 1

# And so on

# Submit updated dataframe back to hosted layer as updates
fc.edit_features(updates=df.spatial.to_featureset())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's quite different from using cursors, but once you get the hang of using dataframes (&lt;A href="https://pandas.pydata.org/pandas-docs/stable/index.html" target="_self"&gt;see the pandas docs for more info&lt;/A&gt;), it will become much, much easier. And more versatile, as pandas is widely used with other python modules, and can import/export a wide variety of file formats.&lt;/P&gt;&lt;P&gt;Rather than using a bunch of if statements, the pandas &lt;STRONG&gt;loc&lt;/STRONG&gt; indexer is grabbing a selection of rows and columns from the dataframe and operating on them separately. Within &lt;STRONG&gt;loc[x, y]&lt;/STRONG&gt;, x represents the rows. Here we supply "df['field_a'] &amp;gt; 0", so we're getting back all the rows that meet the condition. y represents the columns, and specifying a single column by its label, 'target_field', gives us only those values we wish to update.&lt;/P&gt;&lt;P&gt;Setting that selection equal to the 'target_field' value + 1, the dataframe only grabs the value at the same index, so you don't have to specify a subset for that operation.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 12:55:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1037997#M38992</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-18T12:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038054#M38999</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Thanks for the interesting response.&lt;/P&gt;&lt;P&gt;I am indeed using an advanced notebook.&lt;/P&gt;&lt;P&gt;I will take a look at the dataframes, but would also really like to solve the problem with the UpdateCursor.&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 14:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038054#M38999</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-18T14:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038060#M39001</link>
      <description>&lt;P&gt;arcpy and arcpy.da are imported somewhere else in the notebook?&lt;/P&gt;&lt;P&gt;the error stems from the input featureclass name or location or the specified fields.&lt;/P&gt;&lt;P&gt;check both to make sure they "exist" in your code&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 14:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038060#M39001</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-18T14:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038118#M39003</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Thanks a lot. Yes arcpy and arcpy.da are imported at the top of the notebook.&lt;/P&gt;&lt;P&gt;I found a small error in the fields list which I think was breaking it, so the error is now gone. However, now it doesn't seem to be resolving any of the if statements,. In fact it doesn't even appear to be stepping into the UpdateCursor. I tested this by putting a print statement directly after "for row in cursor:'. It runs with no error but isn't doing anyone of the assessments and incrementing the counter.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 15:43:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038118#M39003</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-18T15:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038144#M39005</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/updatecursor-class.htm" target="_blank"&gt;UpdateCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;that row (row[14]???? will only get updated in the last if statement&lt;/P&gt;&lt;P&gt;print the value prior to updating the row, I can't tell what is going on because flipping back and forth to the image is difficult.&amp;nbsp; Try code formatting to make it easier to view code samples&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 16:08:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038144#M39005</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-18T16:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038451#M39022</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry about the problems with image of the code.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from arcgis.gis import GIS
gis = GIS("home")
import arcpy, arcpy.da, requests, json

inputFC = ''https://services8.arcgis.com/eDOP1zOdWfMRGgMh/arcgis/rest/services/?????/FeatureServer/0''
TableFields_VehicleAvailability = ['MajorPumpActualNum','MediumPumpActualNum','FireEnginesActualNum','WaterTankersActualNum','UrbanPumpersActualNum','FoamTendersActualNum','VeldFireVehActualNum','AerialFireActualNum','CommUnitsActualNum','RapidUnitsActualNum','FuelTendersActualNum','CrewBusesActualNum','FireBoatsActualNum','VehReplacePolicy','VehAvailMainScore']#,'VehAvailBonusScore','VehAvailCombScore']

VehAvailMain_Score = 0
VehAvailBonus_Score = 0

#calculate classification score for Vehicle Availability
with arcpy.da.UpdateCursor(inputFC, TableFields_VehicleAvailability) as cursor:
    for row in cursor:
        VehAvailMain_Score = 0
        VehAvailBonus_Score = 0
        if (row[0] &amp;gt; 0 or row[1] &amp;gt; 0): #Major and Medium Pumps
            VehAvailMain_Score = VehAvailMain_Score + 1
            print(row[1])
        if row[2] &amp;gt; 0: #Fire Engines
            VehAvailMain_Score = VehAvailMain_Score + 1
        if row[3] &amp;gt; 0: #Water Tankers
            VehAvailMain_Score = VehAvailMain_Score + 1
        if row[6] &amp;gt; 0: #Veld Fire Vehicles
            VehAvailMain_Score = VehAvailMain_Score + 1
        if (row[13] == 'Yes' or row[13] == 'No'): #vehicle replacement policy because always either Yes or No
            row[14] = VehAvailMain_Score #VehAvailMainScore
        print(VehAvailMain_Score)
        cursor.updateRow(row)
del cursor&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 06:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038451#M39022</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-19T06:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038489#M39023</link>
      <description>&lt;LI-CODE lang="python"&gt;'' .... ''&lt;/LI-CODE&gt;&lt;P&gt;two single quotes surround your inputFC path.&amp;nbsp; You said you found some issue with your field names.&amp;nbsp; Are you still getting the same error message?&lt;/P&gt;&lt;P&gt;also all those&lt;/P&gt;&lt;LI-CODE lang="python"&gt;VehAvailMain_Score = VehAvailMain_Score + 1 #---- current
VehAvailMain_Score += 1  # ---- suggested&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;lines can be written as suggested&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    for row in cursor:
        VehAvailMain_Score = 0  # ---- redundant
        VehAvailBonus_Score = 0 # ---- redundant&lt;/LI-CODE&gt;&lt;P&gt;are defined outside the with statement and again within it.&amp;nbsp; Do you want it redefined there as well?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 08:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038489#M39023</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-19T08:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038513#M39024</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;two single quotes - sorry that is an error that crept in when I copied the code into the reply.&amp;nbsp; The actual code I am testing has the inputFC in one set of single quotes.&lt;/P&gt;&lt;P&gt;I sorted out the issue with the field names and am no longer getting the error message, but the problem now is that the code doesn't seem to be getting into the UpdateCursor. None of the operations within the UpdateCursor are being fired. I placed some print statements within the UpdateCursor to test this and none of them print.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 09:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038513#M39024</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-19T09:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038518#M39025</link>
      <description>&lt;P&gt;If it isn't getting to the cursor, then print statement outside are needed.&lt;/P&gt;&lt;P&gt;You indicate that it is supposed to be a featureclass.&amp;nbsp; If so, then you should be able to print some of its properties.&amp;nbsp; If that fails, then it isn't a featureclass, it doesn't exist or something else.&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/featureclass-properties.htm" target="_blank"&gt;FeatureClass properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 10:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038518#M39025</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-19T10:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038519#M39026</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Its a hosted feature layer in AGOL. I could share the rest endpoint address with you via Private Message?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 10:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038519#M39026</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-19T10:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038632#M39031</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Tested using the feature class properties (featureType and shapeType) and I got results so it is a feature class.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 13:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038632#M39031</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-19T13:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038651#M39037</link>
      <description>&lt;P&gt;In the last incarnation of your script you had print statements, are any printing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/updatecursor-class.htm" target="_blank"&gt;UpdateCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are warnings about what is needed if the data are versioned etc&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 14:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038651#M39037</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-19T14:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038655#M39039</link>
      <description>&lt;P&gt;Using the code below the only print statements that print are print('in') and the last print statement print(VehAvailMain_Score).&lt;/P&gt;&lt;P&gt;Versioning - its an AGOL hosted feature layer. How do you know whether these are versioned? Editing is enabled, as is "Keep track of created and updated features" and "Keep track of who created and last updated features". The last two are suggestive of versioning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from arcgis.gis import GIS
gis = GIS("home")
import arcpy, arcpy.da, requests, json

inputFC = 'https://services8.arcgis.com/eDOP1zOdWfMRGgMh/arcgis/rest/services/????/FeatureServer/0'
TableFields_VehicleAvailability = ['MajorPumpActualNum','MediumPumpActualNum']#,'FireEnginesActualNum','WaterTankersActualNum','UrbanPumpersActualNum','FoamTendersActualNum','VeldFireVehActualNum','AerialFireActualNum','CommUnitsActualNum','RapidUnitsActualNum','FuelTendersActualNum','CrewBusesActualNum','FireBoatsActualNum','VehReplacePolicy','VehAvailMainScore']#,'VehAvailBonusScore','VehAvailCombScore']

VehAvailMain_Score = 0
VehAvailBonus_Score = 0

#calculate classification score for Vehicle Availability
with arcpy.da.UpdateCursor(inputFC, TableFields_VehicleAvailability) as cursor:
    print('in')
    for row in cursor:
        print('in2')
        VehAvailMain_Score = 0
        VehAvailBonus_Score = 0
        if (row[0] &amp;gt; 0 or row[1] &amp;gt; 0): #Major and Medium Pumps
            VehAvailMain_Score += 1# VehAvailMain_Score + 1
            print('in3')
#        if row[2] &amp;gt; 0: #Fire Engines
#            VehAvailMain_Score = VehAvailMain_Score + 1
#        if row[3] &amp;gt; 0: #Water Tankers
#            VehAvailMain_Score = VehAvailMain_Score + 1
#        if row[6] &amp;gt; 0: #Veld Fire Vehicles
#            VehAvailMain_Score = VehAvailMain_Score + 1
#        if (row[13] == 'Yes' or row[13] == 'No'): #vehicle replacement policy because always either Yes or No
#            row[14] = VehAvailMain_Score #VehAvailMainScore
        cursor.updateRow(row)
del cursor
print(VehAvailMain_Score)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 14:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1038655#M39039</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-19T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039311#M39097</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Made a little progress. I adjusted the cursor from an UpdateCursor to a SearchCursor and removed cursor.updateRow(row). The script then successfully runs and completes with the print statements reporting as would be expected.&lt;/P&gt;&lt;P&gt;So this makes me think that there is an issue with the edit settings or sharing of the hosted feature layer? although the user running the script owns the hosted feature layer so sharing shouldn't be the issue. Any idea what settings and sharing are required for the hosted feature layer for it to be editable in this manner?&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I adjusted the settings so that only "Enable Editing" is ticked on and only "Update" and "Attributes only" is allowed. The UpdateCursor was then reinstated in the script. The script runs for a few minutes and then the Notebook returns the following message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GrantBenn1_0-1616425252658.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/9079iE4E256278CD0DD11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GrantBenn1_0-1616425252658.png" alt="GrantBenn1_0-1616425252658.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 15:02:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039311#M39097</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-22T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039341#M39099</link>
      <description>&lt;P&gt;No clue.&amp;nbsp; This may be a Tech Support issue now&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 15:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039341#M39099</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-22T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: error with UpdateCursor in Jupyter notebook</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039662#M39115</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Thanks a lot for the help. I have contacted our local ESRI office.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Grant&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 05:47:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-with-updatecursor-in-jupyter-notebook/m-p/1039662#M39115</guid>
      <dc:creator>GrantBenn1</dc:creator>
      <dc:date>2021-03-23T05:47:20Z</dc:date>
    </item>
  </channel>
</rss>

