<?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 Delete Cursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043321#M60632</link>
    <description>&lt;P&gt;same principle, switch the assignment of None&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 09:31:58 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-04-02T09:31:58Z</dc:date>
    <item>
      <title>Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043267#M60626</link>
      <description>&lt;P&gt;I want to delete specific values in a field. In the code below I used an update cursor to update Wk4_May18May21_ACTIV with the values from Wk3_May11May14_ACTIV that had the word "Planned" in them. Now I want to delete the values from&amp;nbsp;Wk3_May11May14_ACTIV that have the word "Planned" in them but using a delete cursor deletes the entire row. I just want the values in the column deleted (they can be left as null or empty). Also, all of this code is being used in Jupyter notebooks and the data being changed is on AGOL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.UpdateCursor (fc, ['SITE_ID', 'Wk3_May11May14_ACTIV','Wk4_May18May21_ACTIV'], "Wk3_May11May14_ACTIV LIKE '%Planned%'") as cursor:
    for row in cursor:
        row[2] = row[1]
        cursor.updateRow(row)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great, I am fairly new to Python.&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>Fri, 02 Apr 2021 00:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043267#M60626</guid>
      <dc:creator>JamesMcAllister1</dc:creator>
      <dc:date>2021-04-02T00:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043269#M60627</link>
      <description>&lt;P&gt;if the code works for replacement and the query works, then did you try row[2] = None&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 01:07:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043269#M60627</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-02T01:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043286#M60628</link>
      <description>&lt;P&gt;I'm not trying to delete anything from row[2] it's the values in row[1] that I was to delete.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 03:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043286#M60628</guid>
      <dc:creator>JamesMcAllister1</dc:creator>
      <dc:date>2021-04-02T03:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043288#M60629</link>
      <description>&lt;P&gt;Then set row[1] = None.&amp;nbsp; Using the update cursor you can move the value of row[1] into row[2], then delete (set to None) the value in row[1].&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;with arcpy.da.UpdateCursor (fc, ['SITE_ID', 'Wk3_May11May14_ACTIV','Wk4_May18May21_ACTIV'], "Wk3_May11May14_ACTIV LIKE '%Planned%'") as cursor:
    for row in cursor:
        row[2] = row[1]
        row[1] = None
        cursor.updateRow(row)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 04:32:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043288#M60629</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-04-02T04:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043321#M60632</link>
      <description>&lt;P&gt;same principle, switch the assignment of None&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 09:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043321#M60632</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-02T09:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python Delete Cursor</title>
      <link>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043454#M60641</link>
      <description>&lt;P&gt;Amazing thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 17:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-delete-cursor/m-p/1043454#M60641</guid>
      <dc:creator>JamesMcAllister1</dc:creator>
      <dc:date>2021-04-02T17:52:06Z</dc:date>
    </item>
  </channel>
</rss>

