<?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: TypeError: value #1 - unsupported type: list in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054422#M61031</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/444494"&gt;@Tomasz_Tarchalski&lt;/a&gt; .&lt;/P&gt;&lt;P&gt;I was asleep at the wheel.&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 21:06:32 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2021-05-04T21:06:32Z</dc:date>
    <item>
      <title>TypeError: value #1 - unsupported type: list</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1053999#M61013</link>
      <description>&lt;P&gt;I'm trying to slice with an index to get everything that comes after the first value in the MAIL_AD1 field and use the update cursor to put it in the Name_First field. As of now I can only get the second value and nothing more.&lt;/P&gt;&lt;P&gt;Here's the table I'm working with:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab1.png" style="width: 600px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12451i204D250626B5174E/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab1.png" alt="tab1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This puts the correct value in the Name_Last field:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc = r"C:/pathto/fc"
field = ['MAIL_AD1', 'Name_First', 'Name_Last']

def Name_Last(): # this function updates the Name_Last field
    with arcpy.da.UpdateCursor(fc, field) as cursor:
        for row in cursor:
            name = row[0] #get name in MAIL_AD1 list
            if name is None:  continue  # continue to the next iteration in loop if None
            s = str(unit).split() #split strings in MAIL_AD1 field 
            row[2] = s[0] #update Name_Last field with first value in MAIL_AD1 field
            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;&lt;P&gt;But when I try to slice with an index number I get the error, which happens on the row[1] = s[1:] line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def Name_First(): #this function updates the Name_First field
    with arcpy.da.UpdateCursor(fc, field) as cursor:
        for row in cursor: 
            unit = row[0] #get Unit in field list
            if unit is None:  continue  # continue to the next iteration in loop if None
            s = str(unit).split() #split strings in MAIL_AD1 field 
            row[1] = s[1:] #update Name_First field with what comes after first value in MAIL_AD1 field
            cursor.updateRow(row)
    del cursor &lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;TypeError: value #1 - unsupported type: list&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 21:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1053999#M61013</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-03T21:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: list</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054010#M61014</link>
      <description>&lt;P&gt;Your slicing retourns list (s[1:]) with one value, but you cannot insert it into row. Just replace s[1:] with s[1:][0]&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 21:53:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054010#M61014</guid>
      <dc:creator>Tomasz_Tarchalski</dc:creator>
      <dc:date>2021-05-03T21:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: list</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054209#M61020</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/444494"&gt;@Tomasz_Tarchalski&lt;/a&gt;&lt;BR /&gt;If I run&lt;/P&gt;&lt;LI-CODE lang="python"&gt;row[1] = s[1:][0]
print(row[1])&lt;/LI-CODE&gt;&lt;P&gt;it's only returning one value.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;DENNIS
KYLE
LINDA
SUSAN
MICHAEL
NEILL
PAMELA
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is what I'm expecting:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;DENNIS J
KYLE 
LINDA KAY LVG TR
SUSAN K
MICHAEL JO ANN
NEILL DANIEL J
PAMELA
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do this it's back in a list again.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;row[1] = s[1:][0:]
print(row[1])&lt;/LI-CODE&gt;&lt;P&gt;Prints:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;['DENNIS', 'J']
['KYLE']
['LINDA', 'KAY', 'LVG', 'TR']
['SUSAN', 'K']
['MICHAEL', 'JO', 'ANN']
['NEILL', 'DANIEL', 'J']
['PAMELA']
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 14:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054209#M61020</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-04T14:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: list</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054396#M61027</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;s = str(unit).split() # it returns list of ['Lovato', 'Dennis', 'J']
b = s[1:] # returns a list of ['Dennis', 'J']
# so in fact you must again convert list into string like this
c = " ".join(b) # it should retourn a string "Dennis J". you joined by space
#or
c = ", ".join(b) # should retourn "Dennis, J".&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Advice: for this kinds of test run python directly in command line and test it. Or install Visual Studio code, install Python extention and run debugging.&amp;nbsp; or test in arcgis pro notebook...&lt;/P&gt;&lt;P&gt;Regards, Tomasz&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 20:56:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054396#M61027</guid>
      <dc:creator>Tomasz_Tarchalski</dc:creator>
      <dc:date>2021-05-04T20:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: list</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054422#M61031</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/444494"&gt;@Tomasz_Tarchalski&lt;/a&gt; .&lt;/P&gt;&lt;P&gt;I was asleep at the wheel.&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 21:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-list/m-p/1054422#M61031</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-04T21:06:32Z</dc:date>
    </item>
  </channel>
</rss>

